MCPcopy Create free account

hub / github.com/juju/errors / functions

Functions158 in github.com/juju/errors

↓ 37 callersFunctionerrorLocationValue
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 callersFunctionNew
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 callersFunctionnewLocationError
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 callersFunctionCause
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 callersFunctionIs
Is is a proxy for the Is function in Go's standard `errors` library (pkg.go.dev/errors).
functions.go:350
↓ 17 callersFunctionTrace
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 callersFunctionDetails
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 callersFunctionmakeWrappedConstError
(err error, format string, args ...interface{})
errortypes.go:89
↓ 15 callersFunctionwrapErrorWithMsg
(err error, msg string)
errortypes.go:79
↓ 14 callersFunctionAnnotate
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 callersMethodCheck
Check is copied from juju/testing containsChecker
checkers_test.go:52
↓ 14 callersMethodError
()
functions_test.go:521
↓ 12 callersMethodSetLocation
SetLocation records the package path-qualified function name of the error at callDepth stack frames above the call.
error.go:207
↓ 12 callersFunctionWrap
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 callersFunctionAnnotatef
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 callersMethodError
Error implements error.Error.
error.go:158
↓ 9 callersFunctionHide
Hide takes an error and silences it's error string from appearing in fmt like
functions.go:449
↓ 7 callersFunctionErrorf
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 callersFunctionMask
Mask hides the underlying error type, and records the location of the masking.
functions.go:187
↓ 5 callersFunctionMaskf
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 callersFunctionUnwrap
Unwrap is a proxy for the Unwrap function in Go's standard `errors` library (pkg.go.dev/errors).
functions.go:344
↓ 5 callersFunctiondeferredAnnotatef
(err error, format string, args ...interface{})
errortypes_test.go:62
↓ 4 callersFunctionnewError
(message string)
error_test.go:191
↓ 3 callersFunctionDeferredAnnotatef
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 callersFunctionErrorStack
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 callersMethodAs
(e any)
functions_test.go:427
↓ 2 callersMethodCause
()
functions.go:215
↓ 2 callersMethodError
()
error_test.go:187
↓ 2 callersMethodIs
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 callersMethodLocation
Location returns the path-qualified function name where the error was created and the line number
error.go:40
↓ 2 callersMethodMessage
Message returns the top level error message, not including the message from the Previous error.
functions.go:222
↓ 2 callersFunctionSetLocation
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 callersMethodUnderlying
Underlying returns the Previous error, or nil if there is none.
functions.go:226
↓ 2 callersMethodUnwrap
Unwrap implements the errors.Unwrap method returning the error wrapped by fmtNoop.
functions.go:443
↓ 2 callersFunctionWithType
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 callersFunctionWrapf
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 callersFunctionerrorStack
(err error)
functions.go:291
↓ 2 callersFunctiongetLocation
getLocation records the package path-qualified function name of the error at callDepth stack frames above the call.
functions.go:39
↓ 2 callersFunctionnewNonComparableError
Create a non-comparable error
error_test.go:183
↓ 2 callersFunctionrunErrorTests
(c *gc.C, errorTests []errorTest, checkMustSatisfy bool)
errortypes_test.go:90
↓ 2 callersFunctionsameError
Ideally we'd have a way to check identity, but deep equals will do.
error.go:219
↓ 1 callersFunctionAs
As is a proxy for the As function in Go's standard `errors` library (pkg.go.dev/errors).
functions.go:369
↓ 1 callersMethodComplexMessage
()
functions_test.go:408
↓ 1 callersMethodError
ConstError implements error
errortypes.go:17
↓ 1 callersMethodIs
Is compares `target` with e's error type
errortypes.go:67
↓ 1 callersFunctionNewErr
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 callersFunctionNewErrWithCause
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 callersMethodStackTrace
()
functions_test.go:193
↓ 1 callersFunctioncanBeNil
canBeNil is copied from juju/testing
checkers_test.go:38
↓ 1 callersFunctioncheckErrorMatches
(c *gc.C, err error, message string, errInfo *errorInfo)
errortypes_test.go:81
↓ 1 callersMethodequal
(t0 *errorInfo)
errortypes_test.go:49
↓ 1 callersFunctionmustNotSatisfy
(c *gc.C, err error, errInfo *errorInfo)
errortypes_test.go:74
↓ 1 callersFunctionmustSatisfy
(c *gc.C, err error, errInfo *errorInfo)
errortypes_test.go:67
↓ 1 callersFunctionstringOrStringer
stringOrStringer is copied from juju/testing
checkers_test.go:90
FunctionAlreadyExistsf
AlreadyExistsf returns an error which satisfies Is(err, AlreadyExists) and the Locationer interface.
errortypes.go:237
FunctionAsType
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
FunctionBadRequestf
BadRequestf returns an error which satisfies Is(err, BadRequest) and the Locationer interface.
errortypes.go:357
MethodCause
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
MethodCheck
Check is copied from juju/testing satisfiesChecker
checkers_test.go:67
MethodComplexMessage
()
functions_test.go:419
MethodComplexMessage
()
functions_test.go:441
MethodError
()
functions_test.go:342
MethodError
()
functions_test.go:415
MethodError
()
functions_test.go:437
MethodError
Error implementes the error interface.
error.go:65
MethodError
()
error_test.go:201
FunctionExampleAsType
()
functions_test.go:535
FunctionExampleHasType
()
functions_test.go:525
FunctionExampleHide
()
functions_test.go:505
FunctionExampleTrace
()
example_test.go:12
FunctionForbiddenf
Forbiddenf returns an error which satistifes Is(err, Forbidden) and the Locationer interface.
errortypes.go:405
MethodFormat
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
MethodFormat
()
error.go:203
MethodFormat
Format implements the fmt.Formatter interface so that the error wrapped by fmtNoop will not be printed.
functions.go:432
FunctionHasType
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
FunctionIsAlreadyExists
Deprecated: IsAlreadyExists reports whether the err is a AlreadyExists error. Use Is(err, AlreadyExists).
errortypes.go:255
FunctionIsBadRequest
Deprecated: IsBadRequest reports whether err is a BadRequest error. Use Is(err, BadRequest)
errortypes.go:375
FunctionIsForbidden
Deprecated: IsForbidden reports whether err is a Forbidden error. Use Is(err, Forbidden).
errortypes.go:423
FunctionIsMethodNotAllowed
Deprecated: IsMethodNotAllowed reports whether err is a MethodNotAllowed error. Use Is(err, MethodNotAllowed)
errortypes.go:399
FunctionIsNotAssigned
Deprecated: IsNotAssigned reports whether err is a NotAssigned error. Use Is(err, NotAssigned)
errortypes.go:351
FunctionIsNotFound
Deprecated: IsNotFound reports whether err is a NotFound error. Use Is(err, NotFound).
errortypes.go:159
FunctionIsNotImplemented
Deprecated: IsNotImplemented reports whether err is a NotImplemented error. Use Is(err, NotImplemented).
errortypes.go:231
FunctionIsNotProvisioned
Deprecated: IsNotProvisioned reports whether err is a NotProvisioned error. Use Is(err, NotProvisioned).
errortypes.go:327
FunctionIsNotSupported
Deprecated: IsNotSupported reports whether err is a NotSupported error. Use Is(err, NotSupported).
errortypes.go:279
FunctionIsNotValid
Deprecated: IsNotValid reports whether err is a NotValid error. Use Is(err, NotValid).
errortypes.go:303
FunctionIsNotYetAvailable
Deprecated: IsNotYetAvailable reports whether err is a NotYetAvailable err. Use Is(err, NotYetAvailable)
errortypes.go:471
FunctionIsQuotaLimitExceeded
Deprecated: IsQuotaLimitExceeded reports whether err is a QuoteLimitExceeded err. Use Is(err, QuotaLimitExceeded).
errortypes.go:447
FunctionIsTimeout
Deprecated: IsTimeout reports whether err is a Timeout error. Use Is(err, Timeout).
errortypes.go:135
FunctionIsUnauthorized
Deprecated: IsUnauthorized reports whether err is a Unauthorized error. Use Is(err, Unauthorized).
errortypes.go:207
FunctionIsUserNotFound
Deprecated: IsUserNotFound reports whether err is a UserNotFound error. Use Is(err, UserNotFound).
errortypes.go:183
MethodLocation
*locationError implements Locationer.Location interface
error.go:73
MethodLocation
Location returns the package path-qualified function name and line of where the error was most recently created or annotated.
error.go:127
MethodMessage
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
FunctionMethodNotAllowedf
MethodNotAllowedf returns an error which satisfies Is(err, MethodNotAllowed) and the Locationer interface.
errortypes.go:381
FunctionNewAlreadyExists
NewAlreadyExists returns an error which wraps err and satisfies Is(err, AlreadyExists) and the Locationer interface.
errortypes.go:246
FunctionNewBadRequest
NewBadRequest returns an error which wraps err and satisfies Is(err, BadRequest) and the Locationer interface.
errortypes.go:366
FunctionNewForbidden
NewForbidden returns an error which wraps err and satisfies Is(err, Forbidden) and the Locationer interface.
errortypes.go:414
FunctionNewMethodNotAllowed
NewMethodNotAllowed returns an error which wraps err and satisfies Is(err, MethodNotAllowed) and the Locationer interface.
errortypes.go:390
FunctionNewNotAssigned
NewNotAssigned returns an error which wraps err and satisfies Is(err, NotAssigned) and the Locationer interface.
errortypes.go:342
FunctionNewNotFound
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