Exception chaining, or exception wrapping, is an object-oriented programming technique of handling exceptions by re-throwing a caught exception after wrapping it inside a new exception. The original exception is saved as a property (such as cause) of the new exception. The idea is that a method should throw exceptions defined at the same abstraction level as the method itself, but without discarding information from the lower levels.
For example, a method to play a movie file might handle exceptions in reading the file by re-throwing them inside an exception of movie playing. The user interface doesn't need to know whether the error occurred during reading chunk of bytes or calling eof(). It needs only the exception message extracted from cause. The user interface layer will have its own set of exceptions. The one interested in cause can see its stack trace during debugging or in proper log.
Throwing the right kind of exceptions is particularly enforced by checked exceptions in the Java programming language, and starting with language version 1.4 almost all exceptions support chaining.
In runtime engine environments such as Java or .NET there exist tools that attach to the runtime engine and every time that an exception of interest occurs they record debugging information that existed in memory at the time the exception was thrown (stack and heap values). These tools are called Exception Interception and they provide "root-cause" information for exceptions in Java programs that run in production, testing, or development environments.
and 19 Related for: Exception chaining information
Exceptionchaining, or exception wrapping, is an object-oriented programming technique of handling exceptions by re-throwing a caught exception after...
modeled after Perl regular expressions Exceptionchaining allows an exception to encapsulate original lower-level exception Internet Protocol version 6 (IPv6)...
chaining is a method to precisely specify locations along the New York City Subway lines. It measures distances from a fixed point, called chaining zero...
programmers can just use usual chaining, but add question mark symbols before dots (or other characters used for chaining). While the safe navigation operator...
interface is an object-oriented API whose design relies extensively on method chaining. Its goal is to increase code legibility by creating a domain-specific...
rather than letting the exceptions propagate to a higher-level exception-handling routine. In some cases, however, exceptionchaining can be applied instead...
theories is not the supply chain but rather another system, such as the firm or the supplier-buyer relationship. Among the few exceptions is the relational view...
carry out an order is almost always considered insubordination; the only exception usually allowed is if the order itself is illegal (i.e., the person carrying...
federal court proceedings, unless one of nearly thirty exemptions or exceptions applies. The Federal Rules of Evidence define hearsay as: A statement...
practice known as cross-chaining, due to chain stress and wear. In the case of single-speed bicycles and hub gears, the chain length must match the distance...
right is a general exception that applies to all different kinds of uses with all types of works. In the U.S., fair use right/exception is based on a flexible...
organizations. The SPLC's attorney J. Richard Cohen said, "they realized that chaining them together was inefficient; that it was unsafe". Alabama Prison Commissioner...
e.g. pentagon, dodecagon. The triangle, quadrilateral and nonagon are exceptions, although the regular forms trigon, tetragon, and enneagon are sometimes...
Chain of custody (CoC), in legal contexts, is the chronological documentation or paper trail that records the sequence of custody, control, transfer,...
widespread approaches to this problem are separate chaining and open addressing. In separate chaining, the array does not store the value itself but stores...
chain, the more attributes it has, including all the attributes of the beings below it. The minerals are, in the medieval mind, a possible exception to...
a stable population, but also to transfer energy up the pyramid. The exception to this generalization is when portions of a food web are supported by...
Ring–chain tautomers occur when the movement of the proton is accompanied by a change from an open structure to a ring, such as the open chain and cyclic...
three distinct Ig heavy chain isotypes have been identified in cartilaginous fish. With the exception of μ, these Ig heavy chain isotypes appear to be unique...