rethrow
Rethrow is the act of throwing an exception again after it has been caught in an error-handling routine. The primary purpose is to propagate the error to higher levels of the call stack or to defer handling to a different layer while preserving the original context. Rethrowing is distinct from wrapping or chaining, where a new exception is created and the original is attached as a cause; rethrow typically reuses the same exception object.
Rethrowing is commonly used after performing cleanup or after adding local context that does not resolve the
Different languages treat rethrow and stack traces differently. In Java, rethrowing the caught exception with throw
Common considerations: avoid suppressing exceptions; ensure that any added context is informative; consider whether rethrowing plus
See also: exception handling, exception propagation, exception chaining, error handling best practices.