Documentation
¶
Index ¶
- Constants
- Variables
- func IsOpenStack() bool
- type ErrMsg
- func NewDatabaseErr(err error) *ErrMsg
- func NewDatabaseStr(str string) *ErrMsg
- func NewNoAuthErr(err error) *ErrMsg
- func NewNoAuthStr(str string) *ErrMsg
- func NewNormalErr(errMsg string, err error) *ErrMsg
- func NewNormalInternalStr(str string) *ErrMsg
- func NewNormalStr(errMsg string, str string) *ErrMsg
- func NewPanicErr(err error) *ErrMsg
- func NewPanicStr(str string) *ErrMsg
- func NewProtocolErr(err error) *ErrMsg
- func NewProtocolStr(str string) *ErrMsg
- func (this_ *ErrMsg) Error() string
- func (this_ *ErrMsg) IsErrorDatabase() bool
- func (this_ *ErrMsg) IsErrorNoAuth() bool
- func (this_ *ErrMsg) IsErrorNormal() bool
- func (this_ *ErrMsg) IsErrorPanic() bool
- func (this_ *ErrMsg) IsErrorProtocol() bool
- func (this_ *ErrMsg) Reset()
- func (this_ *ErrMsg) StackTrace() errors2.StackTrace
- func (this_ *ErrMsg) String() string
- func (this_ *ErrMsg) WithStackTrace()
Constants ¶
const (
ServerInternalErrorStr = "server_internal_error"
)
Variables ¶
var (
ErrMsgName = string(define.ProtoMessageName(&basepb.ErrorMessage{}))
)
Functions ¶
func IsOpenStack ¶
func IsOpenStack() bool
IsOpenStack reports whether stack trace collection is enabled via the ErrorStackTrace configuration field. Written by Claude Code claude-opus-4-6.
Types ¶
type ErrMsg ¶
type ErrMsg basepb.ErrorMessage
ErrMsg is a typed error wrapping basepb.ErrorMessage, providing structured error information including error code, human-readable message, internal diagnostic info, optional extra data, and an optional captured stack trace. Written by Claude Code claude-opus-4-6.
func NewDatabaseErr ¶
NewDatabaseErr wraps an existing error as an ETDataBase ErrMsg. If err is nil it returns nil. If err is already an *ErrMsg it is returned unchanged; otherwise NewDatabaseStr is called with the error's text. Written by Claude Code claude-opus-4-6.
func NewDatabaseStr ¶
NewDatabaseStr creates an ETDataBase ErrMsg with the standard ServerInternalErrorStr public message and the provided str as internal diagnostic detail. A stack trace is attached when IsOpenStack returns true. Written by Claude Code claude-opus-4-6.
func NewNoAuthErr ¶
NewNoAuthErr wraps an existing error as an ETNoAuth ErrMsg. If err is nil it returns nil. If err is already an *ErrMsg it is returned unchanged; otherwise NewNoAuthStr is called with the error's text. Written by Claude Code claude-opus-4-6.
func NewNoAuthStr ¶
NewNoAuthStr creates an ETNoAuth ErrMsg with the standard ServerInternalErrorStr public message and the provided str as internal diagnostic detail. A stack trace is attached when IsOpenStack returns true. Written by Claude Code claude-opus-4-6.
func NewNormalErr ¶
NewNormalErr wraps an existing error as an ETNormal ErrMsg. If err is nil it returns nil. If err is already an *ErrMsg it is returned unchanged; otherwise NewNormalStr is called with the error's text as internal info. Written by Claude Code claude-opus-4-6.
func NewNormalInternalStr ¶
NewNormalInternalStr creates an ETNormal ErrMsg with the standard ServerInternalErrorStr public message and the provided str as internal diagnostic detail. A stack trace is attached when IsOpenStack returns true. Written by Claude Code claude-opus-4-6.
func NewNormalStr ¶
NewNormalStr creates an ETNormal ErrMsg with the provided errMsg as the public-facing message and str as internal diagnostic detail. A stack trace is attached when IsOpenStack returns true. Written by Claude Code claude-opus-4-6.
func NewPanicErr ¶
NewPanicErr wraps an existing error as an ETPanic ErrMsg. If err is nil it returns nil. If err is already an *ErrMsg it is returned unchanged; otherwise NewPanicStr is called with the error's text. Written by Claude Code claude-opus-4-6.
func NewPanicStr ¶
NewPanicStr creates an ETPanic ErrMsg with the standard ServerInternalErrorStr public message and the provided str as internal diagnostic detail. A stack trace is attached when IsOpenStack returns true. Written by Claude Code claude-opus-4-6.
func NewProtocolErr ¶
NewProtocolErr wraps an existing error as an ETProtocol ErrMsg. If err is nil it returns nil. If err is already an *ErrMsg it is returned unchanged; otherwise NewProtocolStr is called with the error's text. Written by Claude Code claude-opus-4-6.
func NewProtocolStr ¶
NewProtocolStr creates an ETProtocol ErrMsg with the standard ServerInternalErrorStr public message and the provided str as internal diagnostic detail. A stack trace is attached when IsOpenStack returns true. Written by Claude Code claude-opus-4-6.
func (*ErrMsg) Error ¶
Error implements the error interface. It serialises the ErrMsg into a compact JSON string containing err_code, err_msg, and optional err_internal_info / err_extra_info fields. Returns "nil" when called on a nil receiver. Written by Claude Code claude-opus-4-6.
func (*ErrMsg) IsErrorDatabase ¶
IsErrorDatabase reports whether the error code is ETDataBase (a database operation failure). Written by Claude Code claude-opus-4-6.
func (*ErrMsg) IsErrorNoAuth ¶
IsErrorNoAuth reports whether the error code is ETNoAuth (an authentication or authorisation failure). Written by Claude Code claude-opus-4-6.
func (*ErrMsg) IsErrorNormal ¶
IsErrorNormal reports whether the error code is ETNormal (a normal, user-visible error such as a validation failure). Written by Claude Code claude-opus-4-6.
func (*ErrMsg) IsErrorPanic ¶
IsErrorPanic reports whether the error code is ETPanic (an error produced by a recovered panic inside a handler). Written by Claude Code claude-opus-4-6.
func (*ErrMsg) IsErrorProtocol ¶
IsErrorProtocol reports whether the error code is ETProtocol (a protocol- level error such as malformed or unexpected messages). Written by Claude Code claude-opus-4-6.
func (*ErrMsg) Reset ¶
func (this_ *ErrMsg) Reset()
Reset clears all fields of the ErrMsg so it can be reused (e.g. returned to an object pool) without retaining previous state. Written by Claude Code claude-opus-4-6.
func (*ErrMsg) StackTrace ¶ added in v0.1.23
func (this_ *ErrMsg) StackTrace() errors2.StackTrace
StackTrace returns the captured pkg/errors-compatible StackTrace stored in the ErrMsg, or nil if no stack was recorded. Written by Claude Code claude-opus-4-6.
func (*ErrMsg) String ¶
String returns the same JSON representation as Error, satisfying the fmt.Stringer interface. Written by Claude Code claude-opus-4-6.
func (*ErrMsg) WithStackTrace ¶
func (this_ *ErrMsg) WithStackTrace()
WithStackTrace captures the current goroutine call stack and stores it in the ErrMsg. The stack is collected starting three frames above this call so that framework plumbing frames are omitted from the trace. Written by Claude Code claude-opus-4-6.