MCPcopy Create free account
hub / github.com/Mnexa-AI/e2a / NewError

Function NewError

internal/httpapi/errors.go:66–68  ·  view source on GitHub ↗

NewError builds an envelope with an explicit machine-branchable code. Prefer this over the status-only helpers when the caller should be able to branch on something more specific than the HTTP status (e.g. "domain_not_verified" vs a bare 400).

(status int, code, message string)

Source from the content-addressed store, hash-verified

64// to branch on something more specific than the HTTP status (e.g.
65// "domain_not_verified" vs a bare 400).
66func NewError(status int, code, message string) *ErrorEnvelope {
67 return &ErrorEnvelope{status: status, Err: ErrorBody{Code: code, Message: message}}
68}
69
70// WithDetails attaches structured details and returns the envelope for
71// fluent construction.

Callers 15

handleExportUserDataMethod · 0.85
handleDeleteAccountMethod · 0.85
handleGetMyLimitsMethod · 0.85
runIdempotentNSFunction · 0.85
requirePrincipalMethod · 0.85
handleUpdateAgentMethod · 0.85
handleDeleteAgentMethod · 0.85
handleCreateAgentMethod · 0.85
limitEnvelopeFunction · 0.85

Calls

no outgoing calls

Tested by 2