piper-utils 1.1.67 → 1.1.69
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/bin/main.js +61 -50
- package/bin/main.js.map +1 -1
- package/package.json +1 -1
- package/src/audit/audit.js +14 -0
- package/src/audit/audit.test.js +33 -4
- package/src/database/dbUtils/partnerAccess/accessScope.js +99 -99
- package/src/database/dbUtils/partnerAccess/accessScope.test.js +287 -0
- package/src/database/dbUtils/partnerAccess/createAccessHelpers.js +38 -38
- package/src/requestResponse/requestResponse.js +6 -1
|
@@ -125,6 +125,12 @@ export function failure(body = {}, options) {
|
|
|
125
125
|
}
|
|
126
126
|
const newBody = _.merge(NORMAL_ERROR, cleanedErrorBody);
|
|
127
127
|
|
|
128
|
+
const debugLogging = process.env.UTIL_LOG === 'LOG_ALL' || process.env.BUILD_ENV === 'test';
|
|
129
|
+
if (!debugLogging && newBody.statusCode >= 500) {
|
|
130
|
+
// Log the raw error object so thrown Error stacks survive (JSON.stringify drops them)
|
|
131
|
+
console.error('------->UTIL ERROR:', newBody.statusCode, _.get(body, 'message', ''), body);
|
|
132
|
+
}
|
|
133
|
+
|
|
128
134
|
return buildResponse(newBody.statusCode, newBody);
|
|
129
135
|
}
|
|
130
136
|
|
|
@@ -266,7 +272,6 @@ export function detectJoyError(body) {
|
|
|
266
272
|
return acc;
|
|
267
273
|
}, '');
|
|
268
274
|
|
|
269
|
-
console.error('USER VALIDATION ERROR:', body);
|
|
270
275
|
const msg = (joyError?.message || '') + v;
|
|
271
276
|
|
|
272
277
|
if (msg) {
|