Top "Exception" questions

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

How to add manifest permission to an application?

I am trying to access HTTP link using HttpURLConnection in Android to download a file, but I am getting this …

android exception android-manifest
How to catch and print the full exception traceback without halting/exiting the program?

I want to catch and log exceptions without exiting, e.g., try: do_stuff() except Exception, err: print(Exception, err) # …

python exception try-catch traceback
python exception message capturing

import ftplib import urllib2 import os import logging logger = logging.getLogger('ftpuploader') hdlr = logging.FileHandler('ftplog.log') formatter = logging.Formatter(…

python exception logging except
Proper way to declare custom exceptions in modern Python?

What's the proper way to declare custom exception classes in modern Python? My primary goal is to follow whatever standard …

python exception custom-exceptions
Input string was not in a correct format

I'm new with C#, I have some basic knowledge in Java but I can't get this code to run properly. …

c# exception formatexception
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
Why does this iterative list-growing code give IndexError: list assignment index out of range?

Please consider the following code: i = [1, 2, 3, 5, 8, 13] j = [] k = 0 for l in i: j[k] = l k += 1 print j The output (…

python list exception
Python: How to ignore an exception and proceed?

I have a try...except block in my code and When an exception is throw. I really just want to …

python exception
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
Could not load file or assembly ... An attempt was made to load a program with an incorrect format (System.BadImageFormatException)

I have two projects, ProjectA and ProjectB. ProjectB is a console application, which depends on ProjectA. Yesterday, everything was working …

c# exception console-application badimageformatexception