UnauthorizedError

Access errors caused by missing user identity (authentication error) or incorrect security permissions (authorization error).

Description

The UnauthorizedError class is used to manage access errors caused by missing user identity (authentication error) or incorrect security permissions (authorization error).

Constructors

NewUnauthorizedError

Creates an error instance and assigns its values.

NewUnauthorizedError(context, code, message string) *ApplicationError

  • context: IContext - (optional) a context to trace execution through a call chain.
  • code: string - (optional) unique error code. Default: “UNKNOWN”
  • message: string - (optional) a human-readable description of the error.