domain exception

An exception named for a business situation, such as OrderMissing or StorageFailure, rather than for a technical cause.

In more detail

Domain exceptions give each layer one stable type to handle, independent of which library failed underneath. Controller advice can map each one to a suitable HTTP status and problem details body.

Example

@ExceptionHandler(OrderMissing.class)

Related terms

Taught in

References