@venncity/errors
Advanced tools
Comparing version 1.7.16 to 1.7.17
@@ -6,2 +6,10 @@ # Change Log | ||
## [1.7.17](https://github.com/venn-city/npm-shelf/compare/@venncity/errors@1.7.16...@venncity/errors@1.7.17) (2020-08-24) | ||
**Note:** Version bump only for package @venncity/errors | ||
## [1.7.16](https://github.com/venn-city/npm-shelf/compare/@venncity/errors@1.7.15...@venncity/errors@1.7.16) (2020-08-24) | ||
@@ -8,0 +16,0 @@ |
@@ -77,3 +77,3 @@ "use strict"; | ||
if (isPublicAccess) { | ||
tags['auth.publicToken'] = Boolean(isPublicAccess).toString(); | ||
tags['auth.publicToken'] = 'true'; | ||
} | ||
@@ -92,3 +92,9 @@ else if (isService && id) { | ||
if (event.body) { | ||
contexts.requestBody = JSON.parse(event.body); | ||
try { | ||
contexts.requestBody = JSON.parse(event.body); | ||
} | ||
catch (e) { | ||
// In case it is not a json, this is not an error | ||
contexts.requestBody = event.body; | ||
} | ||
} | ||
@@ -95,0 +101,0 @@ else if (event.Records) { |
@@ -102,2 +102,6 @@ "use strict"; | ||
}); | ||
test('event with a string body', () => { | ||
const contexts = sentry.buildErrorContexts(Object.assign(Object.assign({}, testEvents.httpEvent), { body: 'some string' })); | ||
expect(contexts).toMatchSnapshot(); | ||
}); | ||
}); | ||
@@ -104,0 +108,0 @@ describe('setupSentry', () => { |
@@ -54,3 +54,3 @@ import { get, pick } from 'lodash'; | ||
if (isPublicAccess) { | ||
tags['auth.publicToken'] = Boolean(isPublicAccess).toString(); | ||
tags['auth.publicToken'] = 'true'; | ||
} | ||
@@ -68,3 +68,9 @@ else if (isService && id) { | ||
if (event.body) { | ||
contexts.requestBody = JSON.parse(event.body); | ||
try { | ||
contexts.requestBody = JSON.parse(event.body); | ||
} | ||
catch (e) { | ||
// In case it is not a json, this is not an error | ||
contexts.requestBody = event.body; | ||
} | ||
} | ||
@@ -71,0 +77,0 @@ else if (event.Records) { |
@@ -81,2 +81,6 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) { | ||
}); | ||
test('event with a string body', () => { | ||
const contexts = sentry.buildErrorContexts(Object.assign(Object.assign({}, testEvents.httpEvent), { body: 'some string' })); | ||
expect(contexts).toMatchSnapshot(); | ||
}); | ||
}); | ||
@@ -83,0 +87,0 @@ describe('setupSentry', () => { |
{ | ||
"name": "@venncity/errors", | ||
"version": "1.7.16", | ||
"version": "1.7.17", | ||
"author": "Venn Engineering", | ||
@@ -36,3 +36,3 @@ "main": "lib/cjs/index.js", | ||
"@sentry/types": "^5.21.1", | ||
"@venncity/nested-config": "^2.0.24", | ||
"@venncity/nested-config": "^2.0.25", | ||
"fast-safe-stringify": "^2.0.7", | ||
@@ -44,3 +44,3 @@ "joi": "^14.3.1", | ||
}, | ||
"gitHead": "1127813aed1f057885536f1303525f48de265af2" | ||
"gitHead": "4c7a7231b42dea05e58c41c6fbae4cb4ca9528e0" | ||
} |
@@ -79,2 +79,6 @@ import * as sentry from './sentry'; | ||
}); | ||
test('event with a string body', () => { | ||
const contexts = sentry.buildErrorContexts({ ...testEvents.httpEvent, body: 'some string' }); | ||
expect(contexts).toMatchSnapshot(); | ||
}); | ||
}); | ||
@@ -81,0 +85,0 @@ |
@@ -62,3 +62,3 @@ import { get, pick } from 'lodash'; | ||
if (isPublicAccess) { | ||
tags['auth.publicToken'] = Boolean(isPublicAccess).toString(); | ||
tags['auth.publicToken'] = 'true'; | ||
} else if (isService && id) { | ||
@@ -75,3 +75,8 @@ tags['auth.serviceToken'] = id; | ||
if (event.body) { | ||
contexts.requestBody = JSON.parse(event.body); | ||
try { | ||
contexts.requestBody = JSON.parse(event.body); | ||
} catch (e) { | ||
// In case it is not a json, this is not an error | ||
contexts.requestBody = event.body; | ||
} | ||
} else if (event.Records) { | ||
@@ -78,0 +83,0 @@ contexts.records = event.Records.map((record) => { |
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
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
203681
3339