-
Notifications
You must be signed in to change notification settings - Fork 822
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Created new PostgresException for PostgreSQL error responses, distinct from NpgsqlException which now represents other server-related errors (e.g. network issues). Fixes #897. * Moved network exception catch logic to the read/write buffers, which now have the responsibility to break the connector. Should resolve many cases where the connector wasn't been properly broken. Fixes #1068.
- Loading branch information
Showing
22 changed files
with
305 additions
and
167 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
610e319
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'd be really happy if you guys also used the
protected DbException(string message, int errorCode);
constructor in the new NpgSql class :)Still, thanks for throwing DbException instead!
610e319
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@oguzyildiz1991 the problem with that constructor is that it's impossible to pass both an inner exceptions and an error code.
When an inner exception is assigned (e.g. network errors) it seems like an error code is less important - you can simply check the inner exception to understand the error. But for the few other cases where an NpgsqlException is thrown without an inner exception, I can see there might be a need to programmatically identify it...
Do you have a specific exception/scenario that's bothering you?
610e319
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, it's the SSL exception.. Normally we catch it by the error codes in other drivers, but this one threw an InvalidOperationException. So I had to check with the error message (even though being afraid of the localization possibility in the future) but then it returned the same error message in different casing: "Ssl connection requested. No Ssl enabled connection from this host is configured."
So it would be nice if it had an error code too, so we wouldn't have to watch out for localization :)
610e319
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@oguzyildiz1991 I've opened #1072 to track your request. Unfortunately I don't think this will make it in time for 3.1...