13 lines
571 B
Go
13 lines
571 B
Go
|
|
package errs
|
||
|
|
|
||
|
|
// CodedError is implemented by errors that expose a machine-readable error code.
|
||
|
|
// The core starter's Logger implementation consumes this interface to append
|
||
|
|
// error_code to structured log records. The core starter's xerrors implementation
|
||
|
|
// satisfies it via its ErrorCode method.
|
||
|
|
type CodedError interface {
|
||
|
|
// ErrorCode returns a machine-readable identifier for the error condition.
|
||
|
|
// Values are SCREAMING_SNAKE_CASE strings meaningful to frontend consumers
|
||
|
|
// (e.g. "USER_NOT_FOUND"). Internal errors must not carry a code.
|
||
|
|
ErrorCode() string
|
||
|
|
}
|