Closed serhii-dolia closed 4 years ago
The issue was trying to log the axios
-generated error fully, so I could fix it in my code just by logging only part of this JSON.
But still the problem in general remains.
Thank you for the report. We have fixed this problem in version 6.1.3.
Description
We are using the cf-nodejs-logging-support 5.3.2, but I have checked that the latest version has the same problem.
On our production on CF we are having a problem: when we do a request to a particular server and it returns 500 response, the logger is trying to print the error message and it contains the circular JSON (the server response), and the logger crushes our server with this error:
Steps to reproduce:
Download repo and run this code in the root folder:
You will get an error:
How to fix it
In order to fix it, we can use this kind of library: https://www.npmjs.com/package/json-stringify-safe instead of just using JSON.stringify or just try/catch the operation of stringifying.
Let me know if you want me to write the PR or you can do it yourself.
IF you don't think this bug should be fixed, then let me know how we can deal with the problem of this unhandled error that crushes our serever.