исключения

Adapter pattern in Java and exceptions

Hello. I'm trying to implement a common interface for two classes that return the same type of data, but do it in their own w ... established. In another class (LocalDataAdapter) method does not throw exceptions. How to unify the interface for this case?

Java finally

Hello. What is the difference between using finally and putting the code just after the try-catch block? That is, instead of ... the word return in the try and catch blocks, and in the finally block of actions that are mandatory at the end of the method.

How does try... except work?

How does this block work in general? I found a simple code for its use, tied it to the button, but it gives me an error, some ... ShowMessage('number / zero = '+IntToStr(number)); except ShowMessage('Неизвестная ошибка'); end; end;

I can't figure out what my mistake is

What is my mistake? Everything is fine here: std::string rotation(std::string common,int n) { std::string addition=common ... encode(8,"Hello World"); } I get an error: Exception in floating-point operation (memory stack flushed to disk)

Is finally executed if in try return?

try { ... return qwe; } catch {...} finally {...} Is finally satisfied if try has return?

Python Try Except. Handle 2 identical exceptions in a row

I'm writing a parser for a site where blocks have different names on different pages in the same place. I try to work around ... t AttributeError: # Если нет и "gray db rowspan", то запиши "неогранич." db_count = 'неогранич.' print(db_count)

Question about suppressed exceptions within the try-with-resources construct

Here is a quote from the book Oracle-Certified-Professiona-Java-SE-8-Programmer-Exam-1Z0-809 In a try-with-resources stat ... urs. Or is it happening? Then how to understand the output of the exception to the console? Or did I misunderstand something?

difference in throw, throw new, throw ex

What is the difference and why throw an exception at all? I understand that if we have a method called somewhere in which the ... potentially be an error, we should "throw" an exception from there to a place from where the method is not mediocre called,

C exception handling approach#

The question is more focused on an architectural approach or refactoring. For example, there is a console application where t ... like to know how to elegantly handle exceptions of asynchronous methods (asynh await), how to throw them to the main thread?

Exception: Failed to set data for

I write a program for adding parameters to the registry, but everything would not be what, everything turns out, then I launc ... pplication->MessageBox("Параметр добавлен, значение 2 ", "Registry", MB_OK | MB_ICONINFORMATION); delete reg; exit; }**

C++ and multi-level nested try-catch

Consider the following code: try { throw _1(); } catch (...) { try { throw _2(); } catch (...) ... (_2)? 2) Which exception will be thrown next when calling throw;? 3) If throw _3; is not, will anything be pushed further?

Repeating the try block in java

Just starting java. I want that after catch , if there was an error, try was repeated again. I thought to write like this, bu ... введите только число."); continue; } break; } while(true); }

Syntax error in file name, folder name, or volume label

Guys, please tell me how to specify the path to the file so that it does not swear? FileNotFoundException public boolean ch ... rException e) { e.printStackTrace(); } } return false; }

Android-MediaPlayer in the service and IllegalStateException

Hello! I have an activity and a service with a player inside. With the help of activiti, I want to control the player in the ... t.main(ZygoteInit.java:584) 11-10 11:42:14.727 E/AndroidRuntime(32280): at dalvik.system.NativeStart.main(Native Method)

How to throw IllegalArgumentException if the slot value is incorrect

I have a Player class and it has a shotWithWeapon method, I need to throw an IllegalArgumentException exception if the slot v ... gumentException, если значение slot некорректно Weapon weapon = weaponSlots[slot]; weapon.shot(); } }

The application crashes under the debugger-Microsoft C++ Exception (ext. code e06d7363)!

I want to ask for help from reversers and disassemblers. When researching programs, I am very much bothered by one problem: o ... any such instances? Technical information: OS Windows 10, disassembler IDA PRO 7.0, selected debugger Local Windows Debugger.

What is an AssertionError? In which case should I excite it in my own code?

In point 2 of the book "Effective Java, 2nd edition" there is this code snippet in which the author wants to prohibit empty o ... y often in my own code and I want to be sure that I'm doing everything right. Translation of doplumi participant's question.

C++ floating point exception

float y = 0; try { y = 1 / y; } catch (exception& ex) { } How to catch such an exception? I do not catch it for some reason(I use gnu c++).

Exceptions, not clear from where, Java [closed]

Closed. This question is off-topic. Answers to it are not accepted at the moment. ... ole, here is the code with comments on the lines referenced by the exceptions. Tell me what to do and what am I doing wrong?

Handling an exception when comparing two matrices (photos) in C++ OpenCV + possible error in the code

Throws an exception. I don't understand what can be done, and how to catch it in advance. "An unhandled exception occurred at ... ) == 0) // выдаёт исключение тут std::cout << "status image: Yes"; else std::cout << "status image: No";