Top "Exception-handling" questions

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

Catch multiple exceptions in one line (except block)

I know that I can do: try: # do something that may fail except: # do this if ANYTHING goes wrong I …

python exception exception-handling
Get connection string from App.config

var connection = ConnectionFactory.GetConnection( ConfigurationManager.ConnectionStrings["Test"] .ConnectionString, DataBaseProvider); And this is my App.config: <?xml version="1.0" encoding="utf-8" ?&…

c# ado.net exception-handling connection-string app-config
About catching ANY exception

How can I write a try/except block that catches all exceptions?

python exception-handling
What is a StackOverflowError?

What is a StackOverflowError, what causes it, and how should I deal with them?

memory-leaks exception-handling out-of-memory stack-overflow
Catch multiple exceptions at once?

It is discouraged to simply catch System.Exception. Instead, only the "known" exceptions should be caught. Now, this sometimes leads …

c# .net exception exception-handling
Node.js Best Practice Exception Handling

I just started trying out node.js a few days ago. I've realized that the Node is terminated whenever I …

node.js exception-handling serverside-javascript
How do you test that a Python function throws an exception?

How does one write a unittest that fails only if a function doesn't throw an expected exception?

python unit-testing exception exception-handling
Begin, Rescue and Ensure in Ruby?

I've recently started programming in Ruby, and I am looking at exception handling. I was wondering if ensure was the …

ruby-on-rails ruby exception exception-handling error-handling
What is the use of printStackTrace() method in Java?

I am going through a socket program. In it, printStackTrace is called on the IOException object in the catch block. …

java exception-handling printstacktrace
How do I log a Python error with debug information?

I am printing Python exception messages to a log file with logging.error: import logging try: 1/0 except ZeroDivisionError as e: …

python exception logging exception-handling