only one error condition exists, the type may be sufficient, and is an instance of Haskell's class by default. More complex error propagation can be achieved using the or monads, for which similar functionality (using ) is supported. Java A try block must have at least one catch or finally clause and at most one finally clause. try { // Normal execution path. throw new EmptyStackException(); } catch (ExampleException ee) { // Deal with the ExampleException. } finally { // Always run when leaving the try block (including finally clauses), regardless of whether any exceptions were thrown or whether they were handled. // Often used to clean up and close resources such a file handles. // May not be run when System.exit() is called and in other system-wide exceptional conditions (e.g. power loss). } JavaScript The design of JavaScript makes loud/hard errors very uncommon. Soft/quiet errors are much more prevalent. Hard errors propagate to the nearest try statement, which must be followed by either a single catch clause, a single finally clause, or both. try { // Statements in which exceptions might be thrown throw new Error("error"); } catch(error) { // Statements that execute in the event of an exception } finally { // Statements that execute afterward either way } If there is no try statement at all, then the webpage does not crash. Rather, an error is logged to the console and the stack is cleared. However, JavaScript has the interesting quirk of asynchronous externally-invoked entry points. Whereas, in most other languages, there is always some part of the code running at all times, JavaScript does not have to run linearly from start to end. For example, event listeners, Promises, and timers can be invoked by the browser at a later point in time and run in an isolated but shared context with the rest of the code. Observe how the code below will throw a new error every 4 seconds for an indefinite period of time or until the browser/tab/computer is closed. setInterval(function() { throw new Error("Example of an error thrown on a 4 second interval."); }, 4000); Another interesting quirk is polymorphism: JavaScript can throw primitive values as errors. try { throw 12345; // primitive number } catch(error) { console.log(error); // logs 12345 as a primitive number to the console } Note that the catch clause is a catch-all, which catches every type of error. There