Guaranteed execution (finally)
Exception handling
Catching all exceptions
Catching a specific exception
Throwing an exception
Rethrowing exceptions
Defining an exception type
Guaranteed execution (finally)
Method throwing an exception
//Microsoft extension in C and C++
__try {
// guarded code
}
__finally {
// termination code
}
Languages
Python
Java
C#
JavaScript
R
Rust
Golang
Delphi
PHP
Ruby
Swift
Kotlin
Lua
TypeScript
Clojure
Bash
Objective-C