Top "Exception" questions

An exception is an unusual condition that requires deviation from the program's normal flow.

How to use wait and notify in Java without IllegalMonitorStateException?

I have 2 matrices and I need to multiply them and then print the results of each cell. As soon as …

java multithreading exception java-threads
C++ display stack trace on exception

I want to have a way to report the stack trace to the user if an exception is thrown. What …

c++ exception exception-handling stack-trace
Does C++ support 'finally' blocks? (And what's this 'RAII' I keep hearing about?)

Does C++ support 'finally' blocks? What is the RAII idiom? What is the difference between C++'s RAII idiom and …

c++ exception raii finally c++-faq
Difference between java.lang.RuntimeException and java.lang.Exception

Someone please explain the difference between java.lang.RuntimeException and java.lang.Exception? How do I decide which one to …

java exception
java.net.MalformedURLException: no protocol

I am getting Java exception like: java.net.MalformedURLException: no protocol My program is trying to parse an XML string …

java xml exception
How to safely call an async method in C# without await

I have an async method which returns no data: public async Task MyAsyncMethod() { // do some stuff async, don't return any …

c# exception async-await task task-parallel-library
What is an AssertionError? In which case should I throw it from my own code?

In Item 2 of the "Effective Java, 2nd edition" book, there is this snippet of code, in which the author wants …

java exception effective-java
PHPUnit assert that an exception was thrown?

Does anyone know whether there is an assert or something like that which can test whether an exception was thrown …

php exception phpunit assert
How can I get the line number which threw exception?

In a catch block, how can I get the line number which threw an exception?

c# exception
python: How do I know what type of exception occurred?

I have a function called by the main program: try: someFunction() except: print "exception happened!" but in the middle of …

python exception