Questions tagged [Exceptions] (111)

1
answer

What could be the reason? SSLProtocolException: Handshake message sequence violation, 1?

From time to time, but not always, in the back-end application when you connect client crashes and this error. Conditions of departure until the install failed - sometimes occurs when the server is started under the debugger but not 100% of this. javax.net.ssl.SSLProtocolException: Handshake message sequence violation, 1 ...
Timmy_Nienow62 asked April 18th 20 at 12:48
1
answer

Why not a SecurityException when using FusedLocationProviderClient?

//in Activity fun override onStart() { super.onStart() val res = ContextCompat.checkSelfPermission(this, Manifest.permission.ACCESS_FINE_LOCATION)== PackageManager.PERMISSION_GRANTED Log.d(TAG, "ACCESS_FINE_LOCATION: $res") //<=== here false var fusedLocationProviderClient: FusedLocationProviderClient? = null val l...
eleazar55 asked April 18th 20 at 12:19
5
answers

Whether to throw exceptions in the business logic?

Recently met a lot of criticism about this approach, but how to lay the exception to the service method business logic using variations Exceptions try{ $order = $orderService->createOrderAndNotify($orderRequest); return $this->view("success",[ "orderId" => $order->getId() ]); } catch(OrderValidationException ...
Antonietta70 asked April 8th 20 at 10:22
1
answer

How to handle exceptions, and ValueError ValidationError in Django?

Hello! There is a Django app, not rest. In the service layer, where it is processed custom thrown exception with your own text. Type: if column_name not it data_columns: raise ValueError("Oops... Column {} is missing in Talitsa".format(column_name)) Question: how to return the message to the user in the html template? T...
verda.Mayert asked April 7th 20 at 16:09
1
answer

How to catch exceptions in multiple methods?

There are two methods that return an object and, accordingly, can be called a chain (call goes to the controller), for example $object->upload()->resize(); Each method contains a call to its own exceptions. Now I have a try-catch block is written in each method. public function first() { try { } catch { } } publi...
Conrad.Kuhlm asked April 7th 20 at 10:56
1
answer

Why excitation of exceptions triggered by the condition?

# ---> Below in the comments - the problem albom = [] def make_albom(name_artist, name_albom, count_songs=None): if count_songs: return {name_artist: name_albom, 'songs': count_songs } else: return {name_artist: name_albom} try: while True: name_artist = input('artist: ') name_albom = input('album Name: ') if no...
demon asked April 4th 20 at 13:31
0
answer

How to implement automatic restart of the interface in PyQT5 error?

There is a front with buttons written in QtWidgets , which controls the emulation of the browser through Selenium. Sometimes there is a strange bug that closes the interface, but leaves open browser tabs. How to realize automatic restart only the interface in case of crash, keeping that open in the browser? Simplified code ...
terrence.Kessler asked April 3rd 20 at 23:47
1
answer

How to throw an exception?

Have an Address class with constructor public function __construct(string $country,string $city, string $street, string $house, string $building = ") {} I want to validate all of the addresses (country, city, street, building, structure). It all possible private function isCountryValid($param) { if (empty($param) || !preg_...
Gregory.Lebsack13 asked April 3rd 20 at 18:53
1
answer

How to handle Warning'and prop-types? How to access the result of type checking of component?

Hello! The challenge is to do the following: when entering the component props, if some property is not satisfied he has the type of propTypes, UI is the component to display information about what error occurred. As a component to know what came to him the wrong props?
preston.McDermo asked April 3rd 20 at 18:40
3
answers

How to create your own error in JS?

I have a class point, I need to create exceptions.Exception will appear if his arguments do not come and if the number comes not 2 but more or fewer arguments.class Point { constructor(x, y) { this.x = x; this.y = y; } } My version but it does not work correctly. function isNum(num){ if(typeof num.x !== Number || typeof...
Verdie.Roo asked April 2nd 20 at 16:48