@venncity/errors
Advanced tools
Comparing version 1.7.16-addSentry.32 to 1.7.16-addSentry.33
@@ -19,5 +19,14 @@ "use strict"; | ||
sentry_1.reportErrorToSentry(e, { level: logLevel, tags: { traceId: e.traceId }, contexts: { errorThrown: errorToThrow } }); | ||
// Since this is a sync function we cannot await the reportErrorToSentry call. | ||
// flushing to sentry takes time so we need to wait here in a sync manner | ||
sleepSync(2000); | ||
return errorToThrow; | ||
} | ||
exports.handleErrorThrown = handleErrorThrown; | ||
function sleepSync(ms) { | ||
console.log('Sleeping for ', ms, ' millis'); | ||
const start = new Date().getTime(); | ||
const expire = start + ms; | ||
while (new Date().getTime() < expire) { } | ||
} | ||
function getLogLevelFromError(e) { | ||
@@ -24,0 +33,0 @@ return e.logLevel || ERROR; |
@@ -16,4 +16,13 @@ import { v4 as uuidv4 } from 'uuid'; | ||
reportErrorToSentry(e, { level: logLevel, tags: { traceId: e.traceId }, contexts: { errorThrown: errorToThrow } }); | ||
// Since this is a sync function we cannot await the reportErrorToSentry call. | ||
// flushing to sentry takes time so we need to wait here in a sync manner | ||
sleepSync(2000); | ||
return errorToThrow; | ||
} | ||
function sleepSync(ms) { | ||
console.log('Sleeping for ', ms, ' millis'); | ||
const start = new Date().getTime(); | ||
const expire = start + ms; | ||
while (new Date().getTime() < expire) { } | ||
} | ||
function getLogLevelFromError(e) { | ||
@@ -20,0 +29,0 @@ return e.logLevel || ERROR; |
{ | ||
"name": "@venncity/errors", | ||
"version": "1.7.16-addSentry.32+75257c77b", | ||
"version": "1.7.16-addSentry.33+6e346ab71", | ||
"author": "Venn Engineering", | ||
@@ -36,3 +36,3 @@ "main": "lib/cjs/index.js", | ||
"@sentry/types": "^5.21.1", | ||
"@venncity/nested-config": "^2.0.24-addSentry.32+75257c77b", | ||
"@venncity/nested-config": "^2.0.24-addSentry.33+6e346ab71", | ||
"fast-safe-stringify": "^2.0.7", | ||
@@ -44,3 +44,3 @@ "joi": "^14.3.1", | ||
}, | ||
"gitHead": "75257c77b902c481ba014fd57b22bc71f92aebca" | ||
"gitHead": "6e346ab71d48a873546ca9dc54be47d4805fb3e0" | ||
} |
@@ -20,7 +20,19 @@ import { v4 as uuidv4 } from 'uuid'; | ||
reportErrorToSentry(e, { level: logLevel, tags: { traceId: e.traceId }, contexts: { errorThrown: errorToThrow } }); | ||
// Since this is a sync function we cannot await the reportErrorToSentry call. | ||
// flushing to sentry takes time so we need to wait here in a sync manner | ||
sleepSync(2000); | ||
return errorToThrow; | ||
} | ||
function sleepSync(ms) { | ||
console.log('Sleeping for ', ms, ' millis'); | ||
const start = new Date().getTime(); | ||
const expire = start + ms; | ||
while (new Date().getTime() < expire) { } | ||
} | ||
function getLogLevelFromError(e) { | ||
return e.logLevel || ERROR; | ||
} | ||
function generateUUID() { | ||
@@ -27,0 +39,0 @@ return uuidv4(); |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
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
Manifest confusion
Supply chain riskThis package has inconsistent metadata. This could be malicious or caused by an error when publishing the package.
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
Manifest confusion
Supply chain riskThis package has inconsistent metadata. This could be malicious or caused by an error when publishing the package.
Found 1 instance in 1 package
140583
2177