diff --git a/package.json b/package.json index 61abe91..e47b133 100644 --- a/package.json +++ b/package.json @@ -22,7 +22,8 @@ "build:prod": "tsup --minify", "publish": "npm run build:prod", "pretty": "prettier --write .", - "test": "vitest" + "tdd" : "vitest", + "test": "vitest --run" }, "keywords": [ "sern-handler", diff --git a/src/core/contracts/error-handling.ts b/src/core/contracts/error-handling.ts index 6cd32bf..be439cb 100644 --- a/src/core/contracts/error-handling.ts +++ b/src/core/contracts/error-handling.ts @@ -7,6 +7,11 @@ export interface ErrorHandling { */ keepAlive: number; + /** + * @deprecated + * Version 4 will remove this method + */ + crash(err :Error) : never /** * A function that is called on every crash. Updates keepAlive. * If keepAlive is 0, the process crashes. diff --git a/src/core/structures/services/error-handling.ts b/src/core/structures/services/error-handling.ts index 88cfbbc..85957ce 100644 --- a/src/core/structures/services/error-handling.ts +++ b/src/core/structures/services/error-handling.ts @@ -6,6 +6,10 @@ import { ErrorHandling } from '../../contracts'; * Version 4.0.0 will internalize this api. Please refrain from using ModuleStore! */ export class DefaultErrorHandling implements ErrorHandling { + + crash(err: Error): never { + throw err; + } keepAlive = 5; diff --git a/src/core/structures/services/module-manager.ts b/src/core/structures/services/module-manager.ts index bbfbb07..0897c4b 100644 --- a/src/core/structures/services/module-manager.ts +++ b/src/core/structures/services/module-manager.ts @@ -6,7 +6,7 @@ import { CommandType } from '../enums'; /** * @internal * @since 2.0.0 - * Version 4.0.0 will internalize this api. Please refrain from using ModuleStore! + * Version 4.0.0 will internalize this api. Please refrain from using DefaultModuleManager! */ export class DefaultModuleManager implements ModuleManager { constructor(private moduleStore: CoreModuleStore) {}