@exodus/errors
Version: 0.0.0
Type Aliases
SafeError
class
Constructor
Methods
toJSON
toJSON(): SafeErrorJSON
Returns:
SafeErrorJSONAccessors
code
hint
linkedErrors
name
stack
stackFrames
timestamp
SafeCode
type
SafeContextType
type
SafeErrorJSON
type
Properties
code?
hint?
linkedErrors?
name
stack?
string
timestamp
number
SafeName
type
SafeString
type
MAX_LINKED_ERRORS_DEPTH
variable
Type
5
SafeContext
variable
Type
const SafeContext: {
getSchema: { ... }
}sanitizeErrorMessage
variable
Type
const sanitizeErrorMessage: (message: string) => stringSignature
__type(message: string): string
Parameters:
message: string
Returns:
stringcaptureStackTrace
function
Signature
captureStackTrace(err: Error): void
Parameters:
err: Error
Returns:
voidparseStackTrace
function
Signature
parseStackTrace(err: Error): undefined | Frame[]
If this function returns undefined, that likely means `error.stack` has been already accessed.
Consider calling `captureStackTrace` first to capture the customized stack trace, e.g.,
```ts
captureStackTrace(error)
console.log(error.stack)
...
const safeError = SafeError.from(error) // Works even if `error.stack` has been accessed.
```
Parameters:
err: Error
Returns:
undefined | Frame[]Frame
type
Properties
async?
boolean | null
column?
number | null
file?
string | null
function?
string | null
in_app?
boolean | null
line?
number | null
method?
string | null
toplevel?
boolean | null
SafeError
class
Constructor
Methods
toJSON
toJSON(): SafeErrorJSON
Returns:
SafeErrorJSONAccessors
code
hint
linkedErrors
name
stack
stackFrames
timestamp
SafeCode
type
SafeContextType
type
SafeErrorJSON
type
Properties
code?
hint?
linkedErrors?
name
stack?
string
timestamp
number
SafeName
type
SafeString
type
MAX_LINKED_ERRORS_DEPTH
variable
Type
5
SafeContext
variable
Type
const SafeContext: {
getSchema: { ... }
}captureStackTrace
function
Signature
captureStackTrace(err: Error): void
Parameters:
err: Error
Returns:
voidparseStackTrace
function
Signature
parseStackTrace(err: Error): undefined | Frame[]
If this function returns undefined, that likely means `error.stack` has been already accessed.
Consider calling `captureStackTrace` first to capture the customized stack trace, e.g.,
```ts
captureStackTrace(error)
console.log(error.stack)
...
const safeError = SafeError.from(error) // Works even if `error.stack` has been accessed.
```
Parameters:
err: Error
Returns:
undefined | Frame[]sanitizeErrorMessage
function
Signature
sanitizeErrorMessage(message: string): string
Parameters:
message: string
Returns:
stringFrame
type
Properties
async?
boolean | null
column?
number | null
file?
string | null
function?
string | null
in_app?
boolean | null
line?
number | null
method?
string | null
toplevel?
boolean | null
