@mcma/api
Advanced tools
Comparing version 0.16.3 to 0.16.4-beta4
@@ -40,3 +40,3 @@ "use strict"; | ||
catch (error) { | ||
const logger = requestContext.getLogger(); | ||
const logger = await requestContext.getLogger(); | ||
logger?.error(error); | ||
@@ -43,0 +43,0 @@ response.statusCode = http_statuses_1.HttpStatusCode.InternalServerError; |
@@ -18,4 +18,4 @@ import { ConfigVariables, Logger, LoggerProvider, McmaResource, McmaTracker } from "@mcma/core"; | ||
setResponseResourceNotFound(): void; | ||
getTracker(): McmaTracker | undefined; | ||
getLogger(): Logger | undefined; | ||
getTracker(): Promise<McmaTracker | undefined>; | ||
getLogger(): Promise<Logger | undefined>; | ||
} |
@@ -48,3 +48,3 @@ "use strict"; | ||
} | ||
getTracker() { | ||
async getTracker() { | ||
// try to get the tracker from the headers or query string first | ||
@@ -61,3 +61,3 @@ const headerOrQueryParam = (this.request && this.request.headers && this.request.headers[client_1.McmaHeaders.tracker]) || | ||
catch (e) { | ||
this.loggerProvider?.get(this.request.id)?.warn(`Failed to convert text in header or query param 'mcmaTracker' to an McmaTracker object. Error: ${e}`); | ||
(await this.loggerProvider?.get(this.request.id))?.warn(`Failed to convert text in header or query param 'mcmaTracker' to an McmaTracker object. Error: ${e}`); | ||
} | ||
@@ -68,6 +68,6 @@ } | ||
} | ||
getLogger() { | ||
return this.loggerProvider?.get(this.request.id, this.getTracker()); | ||
async getLogger() { | ||
return this.loggerProvider?.get(this.request.id, await this.getTracker()); | ||
} | ||
} | ||
exports.McmaApiRequestContext = McmaApiRequestContext; |
{ | ||
"name": "@mcma/api", | ||
"version": "0.16.3", | ||
"version": "0.16.4-beta4", | ||
"description": "Node module for building APIs based on the EBU MCMA framework", | ||
@@ -40,14 +40,14 @@ "engines": { | ||
"peerDependencies": { | ||
"@mcma/client": "0.16.3", | ||
"@mcma/core": "0.16.3", | ||
"@mcma/data": "0.16.3", | ||
"@mcma/secrets": "0.16.3", | ||
"@mcma/worker-invoker": "0.16.3" | ||
"@mcma/client": "0.16.4-beta4", | ||
"@mcma/core": "0.16.4-beta4", | ||
"@mcma/data": "0.16.4-beta4", | ||
"@mcma/secrets": "0.16.4-beta4", | ||
"@mcma/worker-invoker": "0.16.4-beta4" | ||
}, | ||
"devDependencies": { | ||
"@mcma/client": "0.16.3", | ||
"@mcma/core": "0.16.3", | ||
"@mcma/data": "0.16.3", | ||
"@mcma/secrets": "0.16.3", | ||
"@mcma/worker-invoker": "0.16.3", | ||
"@mcma/client": "0.16.4-beta4", | ||
"@mcma/core": "0.16.4-beta4", | ||
"@mcma/data": "0.16.4-beta4", | ||
"@mcma/secrets": "0.16.4-beta4", | ||
"@mcma/worker-invoker": "0.16.4-beta4", | ||
"@types/node": "^18.15.10", | ||
@@ -54,0 +54,0 @@ "@types/pluralize": "0.0.29", |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
68049