Skip to content

Exceptions in later batched statements aren't handled correctly in NpgsqlDataReader #2820

Closed

Description

@roji

NpgsqlDataReader.NextResultAsync is a non-async method that calls other async methods (i.e. NextResult), and wraps them with try/catch. This means that only exceptions thrown in the initial synchronous part of NextResult are caught - up to the first yielding await, and other exceptions aren't handled.

Rule: be very careful when (and probably avoid) doing any exception handling in sync wrappers over async methods.

Activity

  1. added this to the 4.1.3 milestone on Jan 30, 2020
  2. self-assigned this
    on Jan 30, 2020
  3. added a commit that references this issue on Jan 31, 2020
    e096a8b
  4. added theissue type on Jun 18, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

Projects

No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions