TypeDoc all the thngs
This commit is contained in:
@@ -3,6 +3,11 @@ import {Logging} from "../service/Logging";
|
||||
import {Inject} from "@extollo/di";
|
||||
import {ErrorWithContext} from "@extollo/util";
|
||||
|
||||
/**
|
||||
* Class with logic for handling errors that are thrown at the run-level of the application.
|
||||
*
|
||||
* Colloquially, these are errors thrown ourside the request-lifecycle that are not caught by a unit.
|
||||
*/
|
||||
export class RunLevelErrorHandler {
|
||||
@Inject()
|
||||
protected logging!: Logging
|
||||
@@ -18,6 +23,11 @@ export class RunLevelErrorHandler {
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Wrap the given base Error instance into an ErrorWithContext.
|
||||
* @param e
|
||||
* @param context
|
||||
*/
|
||||
wrapContext(e: Error, context: {[key: string]: any}): ErrorWithContext {
|
||||
if ( e instanceof ErrorWithContext ) {
|
||||
e.context = {...e.context, ...context}
|
||||
|
||||
Reference in New Issue
Block a user