HakiDocs
Java

Exception Propagation

Separation of error-reporting code

Abstract

Exception handling allows for the separation of error-reporting code from the normal flow of business logic.

A method that detects an error.
(throws or receives an exception).
does not need to handle it.
It can use the throws clause
to delegate the responsibility
up the method call stack.

This principle is tied up with
the Single Responsibility Principle
in computer science.

🦕 Sources 


On this page