Top "Exception-handling" questions

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

How to test that no exception is thrown?

I know that one way to do it would be: @Test public void foo(){ try{ //execute code that you expect …

java unit-testing junit exception-handling junit4
Spring Boot REST service exception handling

I am trying to set up a large-scale REST services server. We're using Spring Boot 1.2.1 Spring 4.1.5, and Java 8. Our controllers …

java spring rest exception-handling spring-boot
Is it a good practice to use try-except-else in Python?

From time to time in Python, I see the block: try: try_this(whatever) except SomeException as exception: #Handle exception …

python exception exception-handling try-catch
Get exception description and stack trace which caused an exception, all as a string

I've seen a lot of posts about stack trace and exceptions in Python. But haven't found what I need. I …

python python-2.7 exception-handling stack-trace
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
Why catch and rethrow an exception in C#?

I'm looking at the article C# - Data Transfer Object on serializable DTOs. The article includes this piece of code: …

c# exception-handling try-catch
Catch an exception thrown by an async void method

Using the async CTP from Microsoft for .NET, is it possible to catch an exception thrown by an async method …

c# asynchronous exception-handling async-await task-parallel-library
How can I catch all the exceptions that will be thrown through reading and writing a file?

In Java, is there any way to get(catch) all exceptions instead of catch the exception individually?

java exception file exception-handling
Is there a difference between "throw" and "throw ex"?

There are some posts that asks what the difference between those two are already. (why do I have to even …

c# .net exception exception-handling
Catching an exception while using a Python 'with' statement

To my shame, I can't figure out how to handle exception for python 'with' statement. If I have a code: …

python exception-handling