Skip to content

Error has circular JSON structure #848

Closed
@hrsvrma

Description

@hrsvrma

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions