Skip to content

MySqlException.Data is empty #602

@bgrainger

Description

@bgrainger

The Exception.Data dictionary can be used to "provide additional user-defined information about the exception".

MySQL bug 27436 asked for the error number to be added, so that code that generically handles DbException can read it.

Npgsql adds most public members to the Data dictionary they create: https://github.com/npgsql/npgsql/blob/7b13abaa958375f8166815ab3ffda54c2d17a89a/src/Npgsql/PostgresException.cs#L315-L333

We should use the "Server Error Code" key that Connector/NET uses, and also add "SqlState".

Note that Dictionary<string, object> should not be used as the implementation: npgsql/npgsql#2071.

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