Home Reference Source
import {ErrorManager} from '~/helpers/ErrorManager.js'
public class | source

ErrorManager

Method Summary

Public Methods
public

Returns errors

public

Dumps error log to console.

public

Dumps in new context

public

raise(message: string, id: Symbol | string)

Raises an error with native throw.

public

report(error: Error | AnyError)

Reports an error

public

silent(error: Error | AnyError, message: string, args: Array)

A handled or non-critical error.

public

Pass unhandled errors here

public

warn(message: string, id: Symbol | string)

Warns an AnyError

Public Methods

public dump(): string source

Returns errors

Return:

string

public dumpConsole() source

Dumps error log to console.

public dumpText() source

Dumps in new context

public raise(message: string, id: Symbol | string) source

Raises an error with native throw.

Params:

NameTypeAttributeDescription
message string
id Symbol | string

Error id string or symbol.

public report(error: Error | AnyError) source

Reports an error

Params:

NameTypeAttributeDescription
error Error | AnyError

An error to directly report

public silent(error: Error | AnyError, message: string, args: Array) source

A handled or non-critical error. Logs to console.

Params:

NameTypeAttributeDescription
error Error | AnyError

The error object caught.

message string

Describes the error

args Array

Any other spread arguments that should be provided.

public unhandled(error: Error | AnyError) source

Pass unhandled errors here

Params:

NameTypeAttributeDescription
error Error | AnyError

An unhandled error to report.

public warn(message: string, id: Symbol | string) source

Warns an AnyError

Params:

NameTypeAttributeDescription
message string
id Symbol | string

Describes the type