Package

za.co.absa.commons

error

Permalink

package error

Visibility
  1. Public
  2. All

Type Members

  1. case class ErrorRef(errorId: UUID, timestamp: Long, message: Option[String]) extends Product with Serializable

    Permalink

    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. ErrorRef holds 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 ErrorRef instance (e.g. via ErrorRef.apply() and return it as a response body along with an appropriate response status code (e.g. 500).

  2. abstract class ErrorRefFactory extends AnyRef

    Permalink

Value Members

  1. object ErrorRef extends ErrorRefFactory with Serializable

    Permalink

Ungrouped