You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Error returned/thrown from @elastic/elasticsearch@6 has circular structure hence it is difficult to stringify using JSON.stringify or send in API response (i.e. using express.js). The Error in legacy version is not circular though.
TypeError: Converting circular structure to JSON
at JSON.stringify ()
I am curious to know the reason behind circular structure of Error. And please suggest if there is a simple way to de-circle the Error circular structure.
Thanks
The text was updated successfully, but these errors were encountered:
Hello!
I'll open a pr to address this, but you should avoid sending the entire error message to your users, it will expose you to security vulnerabilities since the error object contains all the connection metadata and much more.
I am not sending the entire error message to user as I too understand the security risk involved. This is just for development environment where I prefer to get error in API response instead of looking into server logs.
HI,
Error returned/thrown from @elastic/elasticsearch@6 has circular structure hence it is difficult to stringify using JSON.stringify or send in API response (i.e. using express.js). The Error in legacy version is not circular though.
TypeError: Converting circular structure to JSON
at JSON.stringify ()
I am curious to know the reason behind circular structure of Error. And please suggest if there is a simple way to de-circle the Error circular structure.
Thanks
The text was updated successfully, but these errors were encountered: