Exception handling (programming)
In computer programming, several programming language mechanisms exist for exception handling. The term exception is typically used to denote a data structure storing information about an exceptional condition. One mechanism to transfer control, or raise an exception, is known as a throw; the exception is said to be thrown. Execution is transferred to a catch.
In computer programming, several programming language mechanisms exist for exception handling. The term exception is typically used to denote a data structure storing information about an exceptional condition. One mechanism to transfer control, or raise an exception, is known as a throw; the exception is said to be thrown. Execution is transferred to a catch. import java.io.IOException; import java.util.Scanner; try { Scanner stdin = new Scanner(System.in); String line = stdin.nextLine(); if (line.length() == 0) { throw new IOException("The line read from console was empty!"); } System.out.printf("Hello %s!%n", line); System.out.println("The task executed successfully."); } catch (IOException e) { System.out.println("Hello!"); } catch (Exception e) { System.out.printf("Error: %s%n", e.getMessage()); } finally { System.out.println("The program is now terminating."); } C does not have try-catch exception handling, but uses return codes for error checking. The setjmp and longjmp standard library functions can be used to implement try-catch handling via macros. Perl 5 uses die for throw and for try-catch. It has CPAN modules that offer try-catch semantics. send (m: MESSAGE) is -- Send m through fast link, if possible, otherwise through slow link. local tried_fast, tried_slow: BOOLEAN do if tried_fast then tried_slow := True send_slow (m) else tried_fast := True send_fast (m) end rescue if not tried_slow then retry end end The boolean local variables are initialized to False at the start. If fails, the body ( clause) will be executed again, causing execution of . If this execution of fails, the clause will execute to the end with no (no clause in the final ), causing the routine execution as a whole to fail. This approach has the merit of defining clearly what "normal" and "abnormal" cases are: an abnormal case, causing an exception, is one in which the routine is unable to fulfill its contract. It defines a clear distribution of roles: the clause (normal body) is in charge of achieving, or attempting to achieve, the routine's contract; the clause is in charge of reestablishing the context and restarting the process, if this has a chance of succeeding, but not of performing any actual computation. Although exceptions in Eiffel have a fairly clear philosophy, Kiniry (2006) criticizes their implementation because "Exceptions that are part of the language definition are represented by INTEGER values, developer-defined exceptions by STRING values. [...] Additionally, because they are basic values and not objects, they have no inherent semantics beyond that which is expressed in a helper routine which necessarily cannot be foolproof because of the representation overloading in effect (e.g., one cannot differentiate two integers of the same value)." C++26 adds support for contracts, which are used as follows. int f(const int x) pre(x != 1) // a precondition assertion post(r : r == x && r != 2) // a postcondition assertion; r names the result object of f { contract_assert(x != 3); // an assertion statement return x; } import java.io.File; import java.io.IOException; import java.util.zip.DataFormatException; // Indicates that IOException and DataFormatException may be thrown public void operateOnFile(File f) throws IOException, DataFormatException { // ... } According to Hanspeter Mössenböck, checked exceptions are less convenient but more robust. Checked exceptions can, at compile time, reduce the incidence of unhandled exceptions surfacing at runtime in a given application. Kiniry writes that "As any Java programmer knows, the volume of try catch code in a typical Java application is sometimes larger than the comparable code necessary for explicit formal parameter and return value checking in other languages that do not have checked exceptions. In fact, the general consensus among in-the-trenches Java programmers is that dealing with checked exceptions is nearly as unpleasant a task as writing documentation. Thus, many programmers report that they “resent” checked exceptions.". Martin Fowler has written "...on the whole I think that exceptions are good, but Java checked exceptions are more trouble than they are worth." As of 2006 no major programming language has followed Java in adding checked exceptions. For example, C# does not require or allow declaration of any exception specifications, with the following posted by Eric Gunnerson: Anders Hejlsberg describes two concerns with checked exceptions: Versioning: A method may be declared to throw exceptions X and Y . In a later version of the code, one cannot throw exception Z from the method, because it would make the new code incompatible with the earlier uses. Checked exceptions require the method's callers to either add Z to their throws clause or handle the exception. Alternately, Z may be misrepresented as an X or a Y . Scalability: In a hierarchical design, each systems may have several subsystems. Each subsystem may throw several exceptions. Each parent system must deal with the exceptions of all subsystems below it, resulting in an exponential number of exceptions to be dealt with. Checked exceptions require all of these exceptions to be dealt with explicitly. To work around these, Hejlsberg says programmers resort to circumventing the feature by using a throws Exception declaration. Another circumvention is to use a try { ... } catch (Exception e) { ... } (or even a try { ... } catch (Throwable t) { ... } ) handler. This is referred to as catch-all exception handling or Pokémon exception handling after the show's catchphrase "Gotta Catch 'Em All!". The Java Tutorials discourage catch-all exception handling as it may catch exceptions "for which the handler was not intended". Still another discouraged circumvention is to make all exceptions subclass java.lang.RuntimeException , thus making the exception unchecked. An encouraged solution is to use a catch-all handler or throws clause but with a specific superclass of all potentially thrown exceptions rather than the general superclass java.lang.Throwable . Another encouraged solution is to define and declare exception types that are suitable for the level of abstraction of the called method and map lower level exceptions to these types by using exception chaining. Kotlin lacks checked exceptions, and even throwing a Java checked exception from Kotlin will not force the client to handle it from Java. However, this can be enabled using the @Throws annotation, which will emit the throws metadata to the JVM. For example, consider the following Kotlin code: import java.io.IOException @Throws(IOException::class) fun readFile() { // ... throw IOException("Failed to read file!") } This would translate roughly back to the following in the JVM: import java.io.IOException; public static final void readFile() throws IOException { // ... throw new IOException("Failed to read file!"); } In C#, an experimental specification, Spec#, released by Microsoft, implements checked exceptions, with a throws clause; all checked exceptions must implement the Microsoft.Contracts.ICheckedException interface. include using std::domain_error; using std::invalid_argument; // this could be similar to the Java signature // void performSomeOperation(int a, int b) throws InvalidArgumentException, ArithmeticException; void performSomeOperation(int a, int b) throw(invalid_argument, domain_error) { // ... } C++ throw clauses could specify any number of any types, even primitives and classes that did not extend std::exception (because C++ supports throwing objects of any type). If no type was named in the throw clause, it would indicate that the function would not throw at all. Exception specifications were not enforced at compile-time. Violations resulted in the standard library function std::unexpected() being called. An empty exception specification could be given, which indicated that the function will throw no exception. This was not made the default when exception handling was added to the language because it would have required too much modification of existing code, would have impeded interaction with code written in other languages, and would have tempted programmers into writing too many handlers at the local level. Explicit use of empty exception specifications could, however, allow C++ compilers to perform significant code and stack layout optimizations that are precluded when exception handling may take place in a function. Some analysts viewed the proper use of exception specifications in C++ as difficult to achieve. This use of exception specifications was included in C++98 and C++03, deprecated in the 2012 C++ language standard (C++11), and was removed from the language in C++17. Throws clauses were replaced by clauses. A function that will not throw any exceptions would now be denoted by the keyword, and instead specified that a function will throw. Although throw clauses are removed from the language, writing only throw() in the signature is legal and is equivalent to noexcept (no exception specified by the throw clause denotes that it cannot throw), however this is still considered deprecated. For transitioning a codebase that uses throw clauses, the removed throw can be redefined as a macro. This is only a temporary fix to allow the code to compile, rather than an actual implementation of checked exceptions. Using this, one can similarly imitate Java throws clauses. // If throw() is empty, it expands to noexcept(true) (same as noexcept), // otherwise it expands to noexcept(false). // A throw statement without parentheses will not expand define throw(...) noexcept(__VA_OPT__(!)true) import std; using std::runtime_error; class FooException : public runtime_error {}; class BarException : public runtime_error {}; // throw(Es...) will expand into noexcept(false) void performSomeOperation(int x, int y) throw(FooException, BarException) { if (x > y) { // throw without a bracket will not expand as a macro throw FooException("x > y"); } else if (y > x) { throw BarException("y > x"); } std::println("x = y = {}", x); } // throw() will expand into noexcept(true) void willNotThrow(int x) throw() { std::println("x = {}", x); } One can also specify that a function is noexcept conditionally on another function being noexcept , like so: void mightThrow(); // The first noexcept is the noexcept clause, the second is the noexcept operator which evaluates to a Boolean value void f() noexcept(noexcept(mightThrow())); Though C++ has no checked exceptions, one can propagate the thrown object up the stack when inside a catch block, by writing (without specifying an object). This re-throws the caught object. This allows operations to be done within the catch block that catches it, before choosing to allow the object to continue propagating upwards. An uncaught exceptions analyzer exists for the OCaml programming language. The tool reports the set of raised exceptions as an extended type signature. But, unlike checked exceptions, the tool does not require any syntactic annotations and is external (i.e. it is possible to compile and run a program without having checked the exceptions). In C++, one can also perform "Pokémon exception handling". Like catch (Throwable t) in Java, C++ supports a catch (...) block, which will catch any thrown object. However, catch (...) has the disadvantage of not naming the caught object, which means it cannot be referred to. This is because in languages like Java, only classes which extend java.lang.Throwable may be thrown, while in C++ any type (even primitives) may be thrown, and thus there is no guaranteeably safe way to store a reference to the caught object of a catch-all block. import std; using std::exception; // Catching only exceptions: try { // ... } catch (const exception& e) { // Catching only exceptions: std::println("An exception was caught: {}", e.what()); } catch (...) { // Catching all thrown objects: std::println("An unknown error was caught"); } The Rust language, instead of using exceptions altogether, represents recoverable exceptions as result types. This is represented as Result (or expected in C++). The advantage of result types over checked exceptions is that while both result types and checked exceptions force users to immediately handle errors, they can also be directly represented as a return type within the language's type system, unlike checked exceptions where the declared potentially thrown exception is part of the function signature but not directly part of its return type. The Rust language does not have exceptions. It instead uses (a result type) for handling runtime errors, and for serious errors the macro is used. Although Rust avoids the try / catch mechanism common in most exception handling languages, it still allows for catching panics, using the std::panic::catch_unwind() function, as the default behavior in Rust when a panic occurs is to perform stack unwinding. ==See also== Automated exception handling Continuation Defensive programming Exception safety Option types and Result types, alternative ways of handling errors in functional programming without exceptions ==Notes== ==References== ===Works cited===
References
- Built-in Exceptions — Python 3.10.4 documentation . docs.python.org . retrieved 17 May 2022 · retrieved 2026-10-06 · rev 1378995886
Cite this reference
MLA "Built-in Exceptions — Python 3.10.4 documentation . docs.python.org . retrieved 17 May 2022." Built-in Exceptions — Python 3. 2026-10-06. https://en.wikipedia.org/w/index.php?oldid=1378995886. Accessed 25 November 2026.
Chicago "Built-in Exceptions — Python 3.10.4 documentation . docs.python.org . retrieved 17 May 2022." Built-in Exceptions — Python 3. 2026-10-06. https://en.wikipedia.org/w/index.php?oldid=1378995886.
APA Built-in Exceptions — Python 3. (2026). Built-in Exceptions — Python 3.10.4 documentation . docs.python.org . retrieved 17 May 2022. Retrieved November 25, 2026, from https://en.wikipedia.org/w/index.php?oldid=1378995886
- Christiansen, Tom. Perl cookbook . O'Reilly . 2003. · retrieved 2026-10-06 · rev 1378995886
Cite this reference
MLA "Christiansen, Tom. Perl cookbook . O'Reilly . 2003." Christiansen, Tom. 2026-10-06. https://en.wikipedia.org/w/index.php?oldid=1378995886. Accessed 25 November 2026.
Chicago "Christiansen, Tom. Perl cookbook . O'Reilly . 2003." Christiansen, Tom. 2026-10-06. https://en.wikipedia.org/w/index.php?oldid=1378995886.
APA Christiansen, Tom. (2026). Christiansen, Tom. Perl cookbook . O'Reilly . 2003. Retrieved November 25, 2026, from https://en.wikipedia.org/w/index.php?oldid=1378995886
- R: Condition Handling and Recovery . search.r-project.org . retrieved 2022-12-05 · retrieved 2022-12-04 · rev 1378995886
Cite this reference
MLA "R: Condition Handling and Recovery . search.r-project.org . retrieved 2022-12-05." R: Condition Handling and Recovery. 2022-12-04. https://en.wikipedia.org/w/index.php?oldid=1378995886. Accessed 25 November 2026.
Chicago "R: Condition Handling and Recovery . search.r-project.org . retrieved 2022-12-05." R: Condition Handling and Recovery. 2022-12-04. https://en.wikipedia.org/w/index.php?oldid=1378995886.
APA R: Condition Handling and Recovery. (2022). R: Condition Handling and Recovery . search.r-project.org . retrieved 2022-12-05. Retrieved November 25, 2026, from https://en.wikipedia.org/w/index.php?oldid=1378995886
- std::uncaught_exception, std::uncaught_exceptions . · retrieved 2026-10-06 · rev 1378995886
Cite this reference
MLA "std::uncaught_exception, std::uncaught_exceptions ." 2026-10-06. https://en.wikipedia.org/w/index.php?oldid=1378995886. Accessed 25 November 2026.
Chicago "std::uncaught_exception, std::uncaught_exceptions ." 2026-10-06. https://en.wikipedia.org/w/index.php?oldid=1378995886.
APA encyclopegia.org. (2026). std::uncaught_exception, std::uncaught_exceptions . Retrieved November 25, 2026, from https://en.wikipedia.org/w/index.php?oldid=1378995886
- Scott Meyers, [http://www.artima.com/cppsource/top_cpp_software.html The Most Important C++ Software...Ever] webarchive|url=https://web.archive.org/web/20110428221802/http://www.artima.com/cppso . · retrieved 2026-10-06 · rev 1378995886
Cite this reference
MLA "Scott Meyers, [http://www.artima.com/cppsource/top_cpp_software.html The Most Important C++ Software...Ever] webarchive|url=https://web.archive.org/web/20110428221802/http://www.artima.com/cppso ." Scott Meyers, [http://www. 2026-10-06. https://en.wikipedia.org/w/index.php?oldid=1378995886. Accessed 25 November 2026.
Chicago "Scott Meyers, [http://www.artima.com/cppsource/top_cpp_software.html The Most Important C++ Software...Ever] webarchive|url=https://web.archive.org/web/20110428221802/http://www.artima.com/cppso ." Scott Meyers, [http://www. 2026-10-06. https://en.wikipedia.org/w/index.php?oldid=1378995886.
APA Scott Meyers, [http://www. (2026). Scott Meyers, [http://www.artima.com/cppsource/top_cpp_software.html The Most Important C++ Software...Ever] webarchive|url=https://web.archive.org/web/20110428221802/http://www.artima.com/cppso . Retrieved November 25, 2026, from https://en.wikipedia.org/w/index.php?oldid=1378995886
- Peter Kleissner. Windows Exception Handling - Peter Kleissner . February 14, 2009. retrieved 2009 · retrieved 2026-10-06 · rev 1378995886
Cite this reference
MLA "Peter Kleissner. Windows Exception Handling - Peter Kleissner . February 14, 2009. retrieved 2009." Peter Kleissner. 2026-10-06. https://en.wikipedia.org/w/index.php?oldid=1378995886. Accessed 25 November 2026.
Chicago "Peter Kleissner. Windows Exception Handling - Peter Kleissner . February 14, 2009. retrieved 2009." Peter Kleissner. 2026-10-06. https://en.wikipedia.org/w/index.php?oldid=1378995886.
APA Peter Kleissner. (2026). Peter Kleissner. Windows Exception Handling - Peter Kleissner . February 14, 2009. retrieved 2009. Retrieved November 25, 2026, from https://en.wikipedia.org/w/index.php?oldid=1378995886
- Graham Hutton, Joel Wright, "[http://www.cs.nott.ac.uk/~gmh/exceptions.pdf Compiling Exceptions Correctly] webarchive|url=https://web.archive.org/web/20140911173720/http://www.cs.nott.ac.uk/~gmh/exc . · retrieved 2026-10-06 · rev 1378995886
Cite this reference
MLA "Graham Hutton, Joel Wright, "[http://www.cs.nott.ac.uk/~gmh/exceptions.pdf Compiling Exceptions Correctly] webarchive|url=https://web.archive.org/web/20140911173720/http://www.cs.nott.ac.uk/~gmh/exc ." Graham Hutton, Joel Wright, "[http://www. 2026-10-06. https://en.wikipedia.org/w/index.php?oldid=1378995886. Accessed 25 November 2026.
Chicago "Graham Hutton, Joel Wright, "[http://www.cs.nott.ac.uk/~gmh/exceptions.pdf Compiling Exceptions Correctly] webarchive|url=https://web.archive.org/web/20140911173720/http://www.cs.nott.ac.uk/~gmh/exc ." Graham Hutton, Joel Wright, "[http://www. 2026-10-06. https://en.wikipedia.org/w/index.php?oldid=1378995886.
APA Graham Hutton, Joel Wright, "[http://www. (2026). Graham Hutton, Joel Wright, "[http://www.cs.nott.ac.uk/~gmh/exceptions.pdf Compiling Exceptions Correctly] webarchive|url=https://web.archive.org/web/20140911173720/http://www.cs.nott.ac.uk/~gmh/exc . Retrieved November 25, 2026, from https://en.wikipedia.org/w/index.php?oldid=1378995886
- Mo, Modi. Making C++ Exception Handling Smaller On x64 . C++ Team Blog . · retrieved 2026-10-06 · rev 1378995886
Cite this reference
MLA "Mo, Modi. Making C++ Exception Handling Smaller On x64 . C++ Team Blog ." Mo, Modi. 2026-10-06. https://en.wikipedia.org/w/index.php?oldid=1378995886. Accessed 25 November 2026.
Chicago "Mo, Modi. Making C++ Exception Handling Smaller On x64 . C++ Team Blog ." Mo, Modi. 2026-10-06. https://en.wikipedia.org/w/index.php?oldid=1378995886.
APA Mo, Modi. (2026). Mo, Modi. Making C++ Exception Handling Smaller On x64 . C++ Team Blog . Retrieved November 25, 2026, from https://en.wikipedia.org/w/index.php?oldid=1378995886
- Stroustrup, Bjarne. C++ exceptions and alternatives . 18 November 2019. retrieved 23 March 2022 · retrieved 2026-10-06 · rev 1378995886
Cite this reference
MLA "Stroustrup, Bjarne. C++ exceptions and alternatives . 18 November 2019. retrieved 23 March 2022." Stroustrup, Bjarne. 2026-10-06. https://en.wikipedia.org/w/index.php?oldid=1378995886. Accessed 25 November 2026.
Chicago "Stroustrup, Bjarne. C++ exceptions and alternatives . 18 November 2019. retrieved 23 March 2022." Stroustrup, Bjarne. 2026-10-06. https://en.wikipedia.org/w/index.php?oldid=1378995886.
APA Stroustrup, Bjarne. (2026). Stroustrup, Bjarne. C++ exceptions and alternatives . 18 November 2019. retrieved 23 March 2022. Retrieved November 25, 2026, from https://en.wikipedia.org/w/index.php?oldid=1378995886
- (such as embedded systems). This second approach is also superior in terms of achieving thread safetyCitation needed|date=September 2012. In comparison to C++ where any type may be thrown . · retrieved 2026-10-06 · rev 1378995886
Cite this reference
MLA "(such as embedded systems). This second approach is also superior in terms of achieving thread safetyCitation needed|date=September 2012. In comparison to C++ where any type may be thrown ." (such as embedded systems). 2026-10-06. https://en.wikipedia.org/w/index.php?oldid=1378995886. Accessed 25 November 2026.
Chicago "(such as embedded systems). This second approach is also superior in terms of achieving thread safetyCitation needed|date=September 2012. In comparison to C++ where any type may be thrown ." (such as embedded systems). 2026-10-06. https://en.wikipedia.org/w/index.php?oldid=1378995886.
APA (such as embedded systems). (2026). (such as embedded systems). This second approach is also superior in terms of achieving thread safetyCitation needed|date=September 2012. In comparison to C++ where any type may be thrown . Retrieved November 25, 2026, from https://en.wikipedia.org/w/index.php?oldid=1378995886
- Contracts for C++ . 13 February 2025. · retrieved 2026-10-06 · rev 1378995886
Cite this reference
MLA "Contracts for C++ . 13 February 2025." Contracts for C++. 2026-10-06. https://en.wikipedia.org/w/index.php?oldid=1378995886. Accessed 25 November 2026.
Chicago "Contracts for C++ . 13 February 2025." Contracts for C++. 2026-10-06. https://en.wikipedia.org/w/index.php?oldid=1378995886.
APA Contracts for C++. (2026). Contracts for C++ . 13 February 2025. Retrieved November 25, 2026, from https://en.wikipedia.org/w/index.php?oldid=1378995886
- Bloch, Joshua. Effective Java . 2008. · retrieved 2026-10-06 · rev 1378995886
Cite this reference
MLA "Bloch, Joshua. Effective Java . 2008." Bloch, Joshua. 2026-10-06. https://en.wikipedia.org/w/index.php?oldid=1378995886. Accessed 25 November 2026.
Chicago "Bloch, Joshua. Effective Java . 2008." Bloch, Joshua. 2026-10-06. https://en.wikipedia.org/w/index.php?oldid=1378995886.
APA Bloch, Joshua. (2026). Bloch, Joshua. Effective Java . 2008. Retrieved November 25, 2026, from https://en.wikipedia.org/w/index.php?oldid=1378995886
- All Exceptions Are Handled . 22 February 2008. · retrieved 2026-10-06 · rev 1378995886
Cite this reference
MLA "All Exceptions Are Handled . 22 February 2008." All Exceptions Are Handled. 2026-10-06. https://en.wikipedia.org/w/index.php?oldid=1378995886. Accessed 25 November 2026.
Chicago "All Exceptions Are Handled . 22 February 2008." All Exceptions Are Handled. 2026-10-06. https://en.wikipedia.org/w/index.php?oldid=1378995886.
APA All Exceptions Are Handled. (2026). All Exceptions Are Handled . 22 February 2008. Retrieved November 25, 2026, from https://en.wikipedia.org/w/index.php?oldid=1378995886
- Mac Developer Library, "[https://developer.apple.com/library/mac/documentation/Cocoa/Conceptual/Exceptions/Concepts/UncaughtExceptions.html Uncaught Exceptions] webarchive|url=https://web.archiv . · retrieved 2026-10-06 · rev 1378995886
Cite this reference
MLA "Mac Developer Library, "[https://developer.apple.com/library/mac/documentation/Cocoa/Conceptual/Exceptions/Concepts/UncaughtExceptions.html Uncaught Exceptions] webarchive|url=https://web.archiv ." Mac Developer Library, "[https://developer. 2026-10-06. https://en.wikipedia.org/w/index.php?oldid=1378995886. Accessed 25 November 2026.
Chicago "Mac Developer Library, "[https://developer.apple.com/library/mac/documentation/Cocoa/Conceptual/Exceptions/Concepts/UncaughtExceptions.html Uncaught Exceptions] webarchive|url=https://web.archiv ." Mac Developer Library, "[https://developer. 2026-10-06. https://en.wikipedia.org/w/index.php?oldid=1378995886.
APA Mac Developer Library, "[https://developer. (2026). Mac Developer Library, "[https://developer.apple.com/library/mac/documentation/Cocoa/Conceptual/Exceptions/Concepts/UncaughtExceptions.html Uncaught Exceptions] webarchive|url=https://web.archiv . Retrieved November 25, 2026, from https://en.wikipedia.org/w/index.php?oldid=1378995886
- MSDN, [https://msdn.microsoft.com/en-us/library/system.appdomain.unhandledexception(v=vs.110).aspx AppDomain.UnhandledException Event] webarchive|url=https://web.archive.org/web/20160304131615/h . · retrieved 2026-10-06 · rev 1378995886
Cite this reference
MLA "MSDN, [https://msdn.microsoft.com/en-us/library/system.appdomain.unhandledexception(v=vs.110).aspx AppDomain.UnhandledException Event] webarchive|url=https://web.archive.org/web/20160304131615/h ." MSDN, [https://msdn. 2026-10-06. https://en.wikipedia.org/w/index.php?oldid=1378995886. Accessed 25 November 2026.
Chicago "MSDN, [https://msdn.microsoft.com/en-us/library/system.appdomain.unhandledexception(v=vs.110).aspx AppDomain.UnhandledException Event] webarchive|url=https://web.archive.org/web/20160304131615/h ." MSDN, [https://msdn. 2026-10-06. https://en.wikipedia.org/w/index.php?oldid=1378995886.
APA MSDN, [https://msdn. (2026). MSDN, [https://msdn.microsoft.com/en-us/library/system.appdomain.unhandledexception(v=vs.110).aspx AppDomain.UnhandledException Event] webarchive|url=https://web.archive.org/web/20160304131615/h . Retrieved November 25, 2026, from https://en.wikipedia.org/w/index.php?oldid=1378995886
- The Python Tutorial, "[https://docs.python.org/2/tutorial/errors.html 8. Errors and Exceptions] webarchive|url=https://web.archive.org/web/20150901043830/https://docs.python.org/2/tutorial/error . · retrieved 2026-10-06 · rev 1378995886
Cite this reference
MLA "The Python Tutorial, "[https://docs.python.org/2/tutorial/errors.html 8. Errors and Exceptions] webarchive|url=https://web.archive.org/web/20150901043830/https://docs.python.org/2/tutorial/error ." The Python Tutorial, "[https://docs. 2026-10-06. https://en.wikipedia.org/w/index.php?oldid=1378995886. Accessed 25 November 2026.
Chicago "The Python Tutorial, "[https://docs.python.org/2/tutorial/errors.html 8. Errors and Exceptions] webarchive|url=https://web.archive.org/web/20150901043830/https://docs.python.org/2/tutorial/error ." The Python Tutorial, "[https://docs. 2026-10-06. https://en.wikipedia.org/w/index.php?oldid=1378995886.
APA The Python Tutorial, "[https://docs. (2026). The Python Tutorial, "[https://docs.python.org/2/tutorial/errors.html 8. Errors and Exceptions] webarchive|url=https://web.archive.org/web/20150901043830/https://docs.python.org/2/tutorial/error . Retrieved November 25, 2026, from https://en.wikipedia.org/w/index.php?oldid=1378995886
- Java Practices -> Provide an uncaught exception handler . www.javapractices.com . retrieved 5 May 2018 · retrieved 2026-10-06 · rev 1378995886
Cite this reference
MLA "Java Practices -> Provide an uncaught exception handler . www.javapractices.com . retrieved 5 May 2018." Java Practices -> Provide an uncaught exception handler. 2026-10-06. https://en.wikipedia.org/w/index.php?oldid=1378995886. Accessed 25 November 2026.
Chicago "Java Practices -> Provide an uncaught exception handler . www.javapractices.com . retrieved 5 May 2018." Java Practices -> Provide an uncaught exception handler. 2026-10-06. https://en.wikipedia.org/w/index.php?oldid=1378995886.
APA Java Practices -> Provide an uncaught exception handler. (2026). Java Practices -> Provide an uncaught exception handler . www.javapractices.com . retrieved 5 May 2018. Retrieved November 25, 2026, from https://en.wikipedia.org/w/index.php?oldid=1378995886
- PyMOTW (Python Module Of The Week), "[https://pymotw.com/2/sys/exceptions.html Exception Handling] webarchive|url=https://web.archive.org/web/20150915032624/https://pymotw.com/2/sys/exceptions.html . · retrieved 2026-10-06 · rev 1378995886
Cite this reference
MLA "PyMOTW (Python Module Of The Week), "[https://pymotw.com/2/sys/exceptions.html Exception Handling] webarchive|url=https://web.archive.org/web/20150915032624/https://pymotw.com/2/sys/exceptions.html ." PyMOTW (Python Module Of The Week), "[https://pymotw. 2026-10-06. https://en.wikipedia.org/w/index.php?oldid=1378995886. Accessed 25 November 2026.
Chicago "PyMOTW (Python Module Of The Week), "[https://pymotw.com/2/sys/exceptions.html Exception Handling] webarchive|url=https://web.archive.org/web/20150915032624/https://pymotw.com/2/sys/exceptions.html ." PyMOTW (Python Module Of The Week), "[https://pymotw. 2026-10-06. https://en.wikipedia.org/w/index.php?oldid=1378995886.
APA PyMOTW (Python Module Of The Week), "[https://pymotw. (2026). PyMOTW (Python Module Of The Week), "[https://pymotw.com/2/sys/exceptions.html Exception Handling] webarchive|url=https://web.archive.org/web/20150915032624/https://pymotw.com/2/sys/exceptions.html . Retrieved November 25, 2026, from https://en.wikipedia.org/w/index.php?oldid=1378995886
- Google Answers: The origin of checked exceptions . retrieved 2011-12-15 · retrieved 2011-12-14 · rev 1378995886
Cite this reference
MLA "Google Answers: The origin of checked exceptions . retrieved 2011-12-15." Google Answers: The origin of checked exceptions. 2011-12-14. https://en.wikipedia.org/w/index.php?oldid=1378995886. Accessed 25 November 2026.
Chicago "Google Answers: The origin of checked exceptions . retrieved 2011-12-15." Google Answers: The origin of checked exceptions. 2011-12-14. https://en.wikipedia.org/w/index.php?oldid=1378995886.
APA Google Answers: The origin of checked exceptions. (2011). Google Answers: The origin of checked exceptions . retrieved 2011-12-15. Retrieved November 25, 2026, from https://en.wikipedia.org/w/index.php?oldid=1378995886
- Java Language Specification, chapter 11.2. http://java.sun.com/docs/books/jls/third_edition/html/exceptions.html#11.2 webarchive|url=https://web.archive.org/web/20061208042454/http://java.sun.com/do . · retrieved 2026-10-06 · rev 1378995886
Cite this reference
MLA "Java Language Specification, chapter 11.2. http://java.sun.com/docs/books/jls/third_edition/html/exceptions.html#11.2 webarchive|url=https://web.archive.org/web/20061208042454/http://java.sun.com/do ." Java Language Specification, chapter 11. 2026-10-06. https://en.wikipedia.org/w/index.php?oldid=1378995886. Accessed 25 November 2026.
Chicago "Java Language Specification, chapter 11.2. http://java.sun.com/docs/books/jls/third_edition/html/exceptions.html#11.2 webarchive|url=https://web.archive.org/web/20061208042454/http://java.sun.com/do ." Java Language Specification, chapter 11. 2026-10-06. https://en.wikipedia.org/w/index.php?oldid=1378995886.
APA Java Language Specification, chapter 11. (2026). Java Language Specification, chapter 11.2. http://java.sun.com/docs/books/jls/third_edition/html/exceptions.html#11.2 webarchive|url=https://web.archive.org/web/20061208042454/http://java.sun.com/do . Retrieved November 25, 2026, from https://en.wikipedia.org/w/index.php?oldid=1378995886
- Cite book |last1=Kiniry |first1=J. R. |year=2006 |url=http://staffwww.dcs.shef.ac.uk/people/A.Simons/remodel/papers/ExceptionsInEiffelAndJava.pdf |chapter=Exceptions in Java and Eiffel: Two Extremes . · retrieved 2026-10-06 · rev 1378995886
Cite this reference
MLA "Cite book |last1=Kiniry |first1=J. R. |year=2006 |url=http://staffwww.dcs.shef.ac.uk/people/A.Simons/remodel/papers/ExceptionsInEiffelAndJava.pdf |chapter=Exceptions in Java and Eiffel: Two Extremes ." Cite book |last1=Kiniry |first1=J. 2026-10-06. https://en.wikipedia.org/w/index.php?oldid=1378995886. Accessed 25 November 2026.
Chicago "Cite book |last1=Kiniry |first1=J. R. |year=2006 |url=http://staffwww.dcs.shef.ac.uk/people/A.Simons/remodel/papers/ExceptionsInEiffelAndJava.pdf |chapter=Exceptions in Java and Eiffel: Two Extremes ." Cite book |last1=Kiniry |first1=J. 2026-10-06. https://en.wikipedia.org/w/index.php?oldid=1378995886.
APA Cite book |last1=Kiniry |first1=J. (2026). Cite book |last1=Kiniry |first1=J. R. |year=2006 |url=http://staffwww.dcs.shef.ac.uk/people/A.Simons/remodel/papers/ExceptionsInEiffelAndJava.pdf |chapter=Exceptions in Java and Eiffel: Two Extremes . Retrieved November 25, 2026, from https://en.wikipedia.org/w/index.php?oldid=1378995886
- Stroustrup: C++ Style and Technique FAQ . www.stroustrup.com . retrieved 5 May 2018 · retrieved 2026-10-06 · rev 1378995886
Cite this reference
MLA "Stroustrup: C++ Style and Technique FAQ . www.stroustrup.com . retrieved 5 May 2018." Stroustrup: C++ Style and Technique FAQ. 2026-10-06. https://en.wikipedia.org/w/index.php?oldid=1378995886. Accessed 25 November 2026.
Chicago "Stroustrup: C++ Style and Technique FAQ . www.stroustrup.com . retrieved 5 May 2018." Stroustrup: C++ Style and Technique FAQ. 2026-10-06. https://en.wikipedia.org/w/index.php?oldid=1378995886.
APA Stroustrup: C++ Style and Technique FAQ. (2026). Stroustrup: C++ Style and Technique FAQ . www.stroustrup.com . retrieved 5 May 2018. Retrieved November 25, 2026, from https://en.wikipedia.org/w/index.php?oldid=1378995886
- McCarthy, John. LISP 1.5 programmer's manual . · retrieved 2026-10-06 · rev 1378995886
Cite this reference
MLA "McCarthy, John. LISP 1.5 programmer's manual ." McCarthy, John. 2026-10-06. https://en.wikipedia.org/w/index.php?oldid=1378995886. Accessed 25 November 2026.
Chicago "McCarthy, John. LISP 1.5 programmer's manual ." McCarthy, John. 2026-10-06. https://en.wikipedia.org/w/index.php?oldid=1378995886.
APA McCarthy, John. (2026). McCarthy, John. LISP 1.5 programmer's manual . Retrieved November 25, 2026, from https://en.wikipedia.org/w/index.php?oldid=1378995886
- IBM System/360 Operating Sys . · retrieved 2026-10-06 · rev 1378995886
Cite this reference
MLA "IBM System/360 Operating Sys ." 2026-10-06. https://en.wikipedia.org/w/index.php?oldid=1378995886. Accessed 25 November 2026.
Chicago "IBM System/360 Operating Sys ." 2026-10-06. https://en.wikipedia.org/w/index.php?oldid=1378995886.
APA encyclopegia.org. (2026). IBM System/360 Operating Sys . Retrieved November 25, 2026, from https://en.wikipedia.org/w/index.php?oldid=1378995886
- Exceptions - Documentation for exception handling in Perl . MetaCPAN . · retrieved 2026-10-06 · rev 1378995886
Cite this reference
MLA "Exceptions - Documentation for exception handling in Perl . MetaCPAN ." Exceptions - Documentation for exception handling in Perl. 2026-10-06. https://en.wikipedia.org/w/index.php?oldid=1378995886. Accessed 25 November 2026.
Chicago "Exceptions - Documentation for exception handling in Perl . MetaCPAN ." Exceptions - Documentation for exception handling in Perl. 2026-10-06. https://en.wikipedia.org/w/index.php?oldid=1378995886.
APA Exceptions - Documentation for exception handling in Perl. (2026). Exceptions - Documentation for exception handling in Perl . MetaCPAN . Retrieved November 25, 2026, from https://en.wikipedia.org/w/index.php?oldid=1378995886
- Stroustrup, Bjarne. C++ Style and Technique FAQ . www.stroustrup.com . retrieved 12 January 2022 · retrieved 2026-10-06 · rev 1378995886
Cite this reference
MLA "Stroustrup, Bjarne. C++ Style and Technique FAQ . www.stroustrup.com . retrieved 12 January 2022." Stroustrup, Bjarne. 2026-10-06. https://en.wikipedia.org/w/index.php?oldid=1378995886. Accessed 25 November 2026.
Chicago "Stroustrup, Bjarne. C++ Style and Technique FAQ . www.stroustrup.com . retrieved 12 January 2022." Stroustrup, Bjarne. 2026-10-06. https://en.wikipedia.org/w/index.php?oldid=1378995886.
APA Stroustrup, Bjarne. (2026). Stroustrup, Bjarne. C++ Style and Technique FAQ . www.stroustrup.com . retrieved 12 January 2022. Retrieved November 25, 2026, from https://en.wikipedia.org/w/index.php?oldid=1378995886
- rp|8:6–8:7 Python and Ruby also permit a clause ( else ) that is used in case no exception occurred before the end of the handler's scope was reached. In its whole, exception handling code might l . · retrieved 2026-10-06 · rev 1378995886
Cite this reference
MLA "rp|8:6–8:7 Python and Ruby also permit a clause ( else ) that is used in case no exception occurred before the end of the handler's scope was reached. In its whole, exception handling code might l ." rp|8:6–8:7 Python and Ruby also permit a clause ( else ) that is used in case no exception occurred before the end of th. 2026-10-06. https://en.wikipedia.org/w/index.php?oldid=1378995886. Accessed 25 November 2026.
Chicago "rp|8:6–8:7 Python and Ruby also permit a clause ( else ) that is used in case no exception occurred before the end of the handler's scope was reached. In its whole, exception handling code might l ." rp|8:6–8:7 Python and Ruby also permit a clause ( else ) that is used in case no exception occurred before the end of th. 2026-10-06. https://en.wikipedia.org/w/index.php?oldid=1378995886.
APA rp|8:6–8:7 Python and Ruby also permit a clause ( else ) that is used in case no exception occurred before the end of th. (2026). rp|8:6–8:7 Python and Ruby also permit a clause ( else ) that is used in case no exception occurred before the end of the handler's scope was reached. In its whole, exception handling code might l . Retrieved November 25, 2026, from https://en.wikipedia.org/w/index.php?oldid=1378995886
Cite this article
MLA
"Exception handling (programming)." encyclopegia.org, 2026, https://encyclopegia.org/wiki/exception-handling-programming. Accessed 25 November 2026.
Chicago
"Exception handling (programming)." encyclopegia.org. Accessed November 25, 2026. https://encyclopegia.org/wiki/exception-handling-programming.
APA
encyclopegia.org. (2026). Exception handling (programming). Retrieved November 25, 2026, from https://encyclopegia.org/wiki/exception-handling-programming
Accessed November 25, 2026 · CC BY-SA 4.0 · citation page · JSON