-
Notifications
You must be signed in to change notification settings - Fork 133
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
SNOW-1737830 log the original error with JSON.stringify differently (default doesn't log non-enumerable properties, thus in Error: none) #944
Conversation
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #944 +/- ##
==========================================
- Coverage 88.93% 88.88% -0.05%
==========================================
Files 69 69
Lines 6685 6685
==========================================
- Hits 5945 5942 -3
- Misses 740 743 +3 ☔ View full report in Codecov by Sentry. |
recheck |
Jenkins job was actually successful yesterday, just progress is not reported back into github apparently. It's still 'Waiting to run this check..' here. |
…err)) which allows for adding the error details to the same logline as the preceding log message
Description
During investigating #936, it turned out that
JSON.stringify
-ing the request's error insf.js
unintentionally hides it. Resulting logline:We're supposed to log the actual full error stack instead.
Tested it and even leaving the circular replacer out and just using the
JSON.stringify(err)
is not enough, logged error is still empty. When logging the rawerr
, the object contents get properly logged:This is what we expect; logging something which actually helps troubleshooting errors instead of
{}
. However this causes unnecessary splitting of loglines.Tested with
JSON.stringify(err, Object.getOwnPropertyNames(err))
, seems to also fulfill the requirement here, and also can be concatenated into the continuation of the single logline.Checklist
npm run lint:check -- CHANGED_FILES
and fix problems in changed code)npm run test:unit
andnpm run test:integration
)