Skip to content

Nest ElasticClient is losing exception information in Async calls #1399

@vbfox

Description

@vbfox

At line 145 of ElasticClient.cs the current code looks like :

if (mr != null)
    throw mr;

var ae = r.Exception.Flatten();
if (ae.InnerException != null)
    throw ae.InnerException;
throw ae;

Re-throwing exceptions without wrapping them with throw ex; mean that their callstack is completely erased (more details), the code should wrap the exceptions in a new exception and throw that instead.

Note: I remarked the issue as it happens on a production system and made our investigations of the problem harder than necessary

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