package error
- Alphabetic
- Public
- All
Type Members
-
case class
ErrorRef(errorId: UUID, timestamp: Long, message: Option[String]) extends Product with Serializable
An unexpected exception wrapper that is aimed for being sent to a client as a result of a failed operation.
An unexpected exception wrapper that is aimed for being sent to a client as a result of a failed operation.
ErrorRefholds a unique identifier (UUID) with which the exception is logged to the server logs. It may optionally also take an error message dedicated for a client, that may be different from the one of the original exception.This way the error message that the client receives can be matched with the corresponding server-side error later for the ease of troubleshooting.
Usage example:
When an unexpected error occurs during processing a client request, instead of propagating the exception to the client verbatim, create an
ErrorRefinstance (e.g. viaErrorRef.apply()and return it as a response body along with an appropriate response status code (e.g. 500). - abstract class ErrorRefFactory extends AnyRef
Value Members
- object ErrorRef extends ErrorRefFactory with Serializable