@message-queue-toolkit/core
Advanced tools
Comparing version 4.0.0 to 4.1.0
@@ -19,2 +19,3 @@ import type { ErrorReporter, ErrorResolver, Either } from '@lokalise/node-core'; | ||
deleteIfExists?: boolean; | ||
waitForConfirmation?: boolean; | ||
forceDeleteInProduction?: boolean; | ||
@@ -68,4 +69,4 @@ }; | ||
protected logMessage(messageLogEntry: unknown): void; | ||
protected handleError(err: unknown): void; | ||
protected handleError(err: unknown, context?: Record<string, unknown>): void; | ||
abstract close(): Promise<unknown>; | ||
} |
@@ -35,7 +35,15 @@ "use strict"; | ||
} | ||
handleError(err) { | ||
handleError(err, context) { | ||
const logObject = (0, node_core_1.resolveGlobalErrorLogObject)(err); | ||
this.logger.error(logObject); | ||
if (logObject === 'string') { | ||
this.logger.error(context, logObject); | ||
} | ||
else if (typeof logObject === 'object') { | ||
this.logger.error({ | ||
...logObject, | ||
...context, | ||
}); | ||
} | ||
if (node_util_1.types.isNativeError(err)) { | ||
this.errorReporter.report({ error: err }); | ||
this.errorReporter.report({ error: err, context }); | ||
} | ||
@@ -42,0 +50,0 @@ } |
{ | ||
"name": "@message-queue-toolkit/core", | ||
"version": "4.0.0", | ||
"version": "4.1.0", | ||
"private": false, | ||
@@ -29,11 +29,11 @@ "license": "MIT", | ||
"devDependencies": { | ||
"@types/node": "^20.7.0", | ||
"@typescript-eslint/eslint-plugin": "^6.7.3", | ||
"@typescript-eslint/parser": "^6.7.3", | ||
"del-cli": "^5.0.0", | ||
"eslint": "^8.44.0", | ||
"@types/node": "^20.9.2", | ||
"@typescript-eslint/eslint-plugin": "^6.11.0", | ||
"@typescript-eslint/parser": "^6.11.0", | ||
"del-cli": "^5.1.0", | ||
"eslint": "^8.54.0", | ||
"eslint-config-prettier": "^9.0.0", | ||
"eslint-plugin-import": "^2.27.5", | ||
"eslint-plugin-prettier": "^5.0.0", | ||
"prettier": "^3.0.0", | ||
"eslint-plugin-import": "^2.29.0", | ||
"eslint-plugin-prettier": "^5.0.1", | ||
"prettier": "^3.1.0", | ||
"typescript": "^5.2.2" | ||
@@ -40,0 +40,0 @@ }, |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
31641
462