Code
Hub
Workspaces
Following
Trending
Connect
MCP
copy
Create free account
hub
/
github.com/juju/errors
/ functions
Functions
158 in github.com/juju/errors
⨍
Functions
158
◇
Types & classes
24
↓ 37 callers
Function
errorLocationValue
errorLocationValue provides the function name and line number for where this function was called from - 1 line. What this means is that the returned v
package_test.go:23
↓ 31 callers
Function
New
New is a drop in replacement for the standard library errors module that records the location that the error is created. For example: return errors.N
functions.go:19
↓ 31 callers
Function
newLocationError
newLocationError constructs a new Locationer error from the supplied error with the location set to callDepth in the stack. If a nill error is provide
error.go:58
↓ 27 callers
Function
Cause
Cause returns the cause of the given error. This will be either the original error, or the result of a Wrap or Mask call. Cause is the usual way to
functions.go:203
↓ 22 callers
Function
Is
Is is a proxy for the Is function in Go's standard `errors` library (pkg.go.dev/errors).
functions.go:350
↓ 17 callers
Function
Trace
Trace adds the location of the Trace call to the stack. The Cause of the resulting error is the same as the error parameter. If the other error is n
functions.go:58
↓ 15 callers
Function
Details
Details returns information about the stack of errors wrapped by err, in the format: [{filename:99: error one} {otherfile:55: cause of error one}]
functions.go:241
↓ 15 callers
Function
makeWrappedConstError
(err error, format string, args ...interface{})
errortypes.go:89
↓ 15 callers
Function
wrapErrorWithMsg
(err error, msg string)
errortypes.go:79
↓ 14 callers
Function
Annotate
Annotate is used to add extra context to an existing error. The location of the Annotate call is recorded with the annotations. The file, line and fun
functions.go:77
↓ 14 callers
Method
Check
Check is copied from juju/testing containsChecker
checkers_test.go:52
↓ 14 callers
Method
Error
()
functions_test.go:521
↓ 12 callers
Method
SetLocation
SetLocation records the package path-qualified function name of the error at callDepth stack frames above the call.
error.go:207
↓ 12 callers
Function
Wrap
Wrap changes the Cause of the error. The location of the Wrap call is also stored in the error stack. For example: if err := SomeFunc(); err != nil {
functions.go:143
↓ 10 callers
Function
Annotatef
Annotatef is used to add extra context to an existing error. The location of the Annotate call is recorded with the annotations. The file, line and fu
functions.go:99
↓ 10 callers
Method
Error
Error implements error.Error.
error.go:158
↓ 9 callers
Function
Hide
Hide takes an error and silences it's error string from appearing in fmt like
functions.go:449
↓ 7 callers
Function
Errorf
Errorf creates a new annotated error and records the location that the error is created. This should be a drop in replacement for fmt.Errorf. For ex
functions.go:31
↓ 6 callers
Function
Mask
Mask hides the underlying error type, and records the location of the masking.
functions.go:187
↓ 5 callers
Function
Maskf
Maskf masks the given error with the given format string and arguments (like fmt.Sprintf), returning a new error that maintains the error stack, but h
functions.go:174
↓ 5 callers
Function
Unwrap
Unwrap is a proxy for the Unwrap function in Go's standard `errors` library (pkg.go.dev/errors).
functions.go:344
↓ 5 callers
Function
deferredAnnotatef
(err error, format string, args ...interface{})
errortypes_test.go:62
↓ 4 callers
Function
newError
(message string)
error_test.go:191
↓ 3 callers
Function
DeferredAnnotatef
DeferredAnnotatef annotates the given error (when it is not nil) with the given format string and arguments (like fmt.Sprintf). If *err is nil, Deferr
functions.go:121
↓ 3 callers
Function
ErrorStack
ErrorStack returns a string representation of the annotated error. If the error passed as the parameter is not an annotated error, the result is simpl
functions.go:287
↓ 2 callers
Method
As
(e any)
functions_test.go:427
↓ 2 callers
Method
Cause
()
functions.go:215
↓ 2 callers
Method
Error
()
error_test.go:187
↓ 2 callers
Method
Is
Is implements errors.Is. It useful for us to be able to check if an error chain has fmtNoop for formatting purposes.
functions.go:436
↓ 2 callers
Method
Location
Location returns the path-qualified function name where the error was created and the line number
error.go:40
↓ 2 callers
Method
Message
Message returns the top level error message, not including the message from the Previous error.
functions.go:222
↓ 2 callers
Function
SetLocation
SetLocation takes a given error and records where in the stack SetLocation was called from and returns the wrapped error with the location information
functions.go:415
↓ 2 callers
Method
Underlying
Underlying returns the Previous error, or nil if there is none.
functions.go:226
↓ 2 callers
Method
Unwrap
Unwrap implements the errors.Unwrap method returning the error wrapped by fmtNoop.
functions.go:443
↓ 2 callers
Function
WithType
WithType is responsible for annotating an already existing error so that it also satisfies that of a ConstError. The resultant error returned should s
errortypes.go:105
↓ 2 callers
Function
Wrapf
Wrapf changes the Cause of the error, and adds an annotation. The location of the Wrap call is also stored in the error stack. For example: if err :=
functions.go:160
↓ 2 callers
Function
errorStack
(err error)
functions.go:291
↓ 2 callers
Function
getLocation
getLocation records the package path-qualified function name of the error at callDepth stack frames above the call.
functions.go:39
↓ 2 callers
Function
newNonComparableError
Create a non-comparable error
error_test.go:183
↓ 2 callers
Function
runErrorTests
(c *gc.C, errorTests []errorTest, checkMustSatisfy bool)
errortypes_test.go:90
↓ 2 callers
Function
sameError
Ideally we'd have a way to check identity, but deep equals will do.
error.go:219
↓ 1 callers
Function
As
As is a proxy for the As function in Go's standard `errors` library (pkg.go.dev/errors).
functions.go:369
↓ 1 callers
Method
ComplexMessage
()
functions_test.go:408
↓ 1 callers
Method
Error
ConstError implements error
errortypes.go:17
↓ 1 callers
Method
Is
Is compares `target` with e's error type
errortypes.go:67
↓ 1 callers
Function
NewErr
NewErr is used to return an Err for the purpose of embedding in other structures. The location is not specified, and needs to be set with a call to S
error.go:96
↓ 1 callers
Function
NewErrWithCause
NewErrWithCause is used to return an Err with cause by other error for the purpose of embedding in other structures. The location is not specified, an
error.go:117
↓ 1 callers
Method
StackTrace
()
functions_test.go:193
↓ 1 callers
Function
canBeNil
canBeNil is copied from juju/testing
checkers_test.go:38
↓ 1 callers
Function
checkErrorMatches
(c *gc.C, err error, message string, errInfo *errorInfo)
errortypes_test.go:81
↓ 1 callers
Method
equal
(t0 *errorInfo)
errortypes_test.go:49
↓ 1 callers
Function
mustNotSatisfy
(c *gc.C, err error, errInfo *errorInfo)
errortypes_test.go:74
↓ 1 callers
Function
mustSatisfy
(c *gc.C, err error, errInfo *errorInfo)
errortypes_test.go:67
↓ 1 callers
Function
stringOrStringer
stringOrStringer is copied from juju/testing
checkers_test.go:90
Function
AlreadyExistsf
AlreadyExistsf returns an error which satisfies Is(err, AlreadyExists) and the Locationer interface.
errortypes.go:237
Function
AsType
AsType is a convenience method for checking and getting an error from within a chain that is of type T. If no error is found of type T in the chain th
functions.go:396
Function
BadRequestf
BadRequestf returns an error which satisfies Is(err, BadRequest) and the Locationer interface.
errortypes.go:357
Method
Cause
Cause returns the most recent error in the error stack that meets one of these criteria: the original error that was raised; the new error that was pa
error.go:146
Method
Check
Check is copied from juju/testing satisfiesChecker
checkers_test.go:67
Method
ComplexMessage
()
functions_test.go:419
Method
ComplexMessage
()
functions_test.go:441
Method
Error
()
functions_test.go:342
Method
Error
()
functions_test.go:415
Method
Error
()
functions_test.go:437
Method
Error
Error implementes the error interface.
error.go:65
Method
Error
()
error_test.go:201
Function
ExampleAsType
()
functions_test.go:535
Function
ExampleHasType
()
functions_test.go:525
Function
ExampleHide
()
functions_test.go:505
Function
ExampleTrace
()
example_test.go:12
Function
Forbiddenf
Forbiddenf returns an error which satistifes Is(err, Forbidden) and the Locationer interface.
errortypes.go:405
Method
Format
Format implements fmt.Formatter When printing errors with %+v it also prints the stack trace. %#v unsurprisingly will print the real underlying type.
error.go:177
Method
Format
()
error.go:203
Method
Format
Format implements the fmt.Formatter interface so that the error wrapped by fmtNoop will not be printed.
functions.go:432
Function
HasType
HasType is a function wrapper around AsType dropping the where return value from AsType() making a function that can be used like this: return HasTyp
functions.go:362
Function
IsAlreadyExists
Deprecated: IsAlreadyExists reports whether the err is a AlreadyExists error. Use Is(err, AlreadyExists).
errortypes.go:255
Function
IsBadRequest
Deprecated: IsBadRequest reports whether err is a BadRequest error. Use Is(err, BadRequest)
errortypes.go:375
Function
IsForbidden
Deprecated: IsForbidden reports whether err is a Forbidden error. Use Is(err, Forbidden).
errortypes.go:423
Function
IsMethodNotAllowed
Deprecated: IsMethodNotAllowed reports whether err is a MethodNotAllowed error. Use Is(err, MethodNotAllowed)
errortypes.go:399
Function
IsNotAssigned
Deprecated: IsNotAssigned reports whether err is a NotAssigned error. Use Is(err, NotAssigned)
errortypes.go:351
Function
IsNotFound
Deprecated: IsNotFound reports whether err is a NotFound error. Use Is(err, NotFound).
errortypes.go:159
Function
IsNotImplemented
Deprecated: IsNotImplemented reports whether err is a NotImplemented error. Use Is(err, NotImplemented).
errortypes.go:231
Function
IsNotProvisioned
Deprecated: IsNotProvisioned reports whether err is a NotProvisioned error. Use Is(err, NotProvisioned).
errortypes.go:327
Function
IsNotSupported
Deprecated: IsNotSupported reports whether err is a NotSupported error. Use Is(err, NotSupported).
errortypes.go:279
Function
IsNotValid
Deprecated: IsNotValid reports whether err is a NotValid error. Use Is(err, NotValid).
errortypes.go:303
Function
IsNotYetAvailable
Deprecated: IsNotYetAvailable reports whether err is a NotYetAvailable err. Use Is(err, NotYetAvailable)
errortypes.go:471
Function
IsQuotaLimitExceeded
Deprecated: IsQuotaLimitExceeded reports whether err is a QuoteLimitExceeded err. Use Is(err, QuotaLimitExceeded).
errortypes.go:447
Function
IsTimeout
Deprecated: IsTimeout reports whether err is a Timeout error. Use Is(err, Timeout).
errortypes.go:135
Function
IsUnauthorized
Deprecated: IsUnauthorized reports whether err is a Unauthorized error. Use Is(err, Unauthorized).
errortypes.go:207
Function
IsUserNotFound
Deprecated: IsUserNotFound reports whether err is a UserNotFound error. Use Is(err, UserNotFound).
errortypes.go:183
Method
Location
*locationError implements Locationer.Location interface
error.go:73
Method
Location
Location returns the package path-qualified function name and line of where the error was most recently created or annotated.
error.go:127
Method
Message
Message returns the message stored with the most recent location. This is the empty string if the most recent call was Trace, or the message stored wi
error.go:153
Function
MethodNotAllowedf
MethodNotAllowedf returns an error which satisfies Is(err, MethodNotAllowed) and the Locationer interface.
errortypes.go:381
Function
NewAlreadyExists
NewAlreadyExists returns an error which wraps err and satisfies Is(err, AlreadyExists) and the Locationer interface.
errortypes.go:246
Function
NewBadRequest
NewBadRequest returns an error which wraps err and satisfies Is(err, BadRequest) and the Locationer interface.
errortypes.go:366
Function
NewForbidden
NewForbidden returns an error which wraps err and satisfies Is(err, Forbidden) and the Locationer interface.
errortypes.go:414
Function
NewMethodNotAllowed
NewMethodNotAllowed returns an error which wraps err and satisfies Is(err, MethodNotAllowed) and the Locationer interface.
errortypes.go:390
Function
NewNotAssigned
NewNotAssigned returns an error which wraps err and satisfies Is(err, NotAssigned) and the Locationer interface.
errortypes.go:342
Function
NewNotFound
NewNotFound returns an error which wraps err and satisfies Is(err, NotFound) and the Locationer interface.
errortypes.go:150
next →
1–100 of 158, ranked by callers