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.
@@ -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) {