Skip to content

Commit

Permalink
Classify connection exceptions as operational errors to better confor…
Browse files Browse the repository at this point in the history
…m with PEP 249
  • Loading branch information
Justas Sadzevicius committed Sep 7, 2020
1 parent 6de8c0c commit 5a39504
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions psycopg/error_type.c
Expand Up @@ -65,6 +65,8 @@ base_exception_from_sqlstate(const char *sqlstate)
switch (sqlstate[0]) {
case '0':
switch (sqlstate[1]) {
case '8': /* Class 08 - Connection Exception */
return OperationalError;
case 'A': /* Class 0A - Feature Not Supported */
return NotSupportedError;
}
Expand Down

0 comments on commit 5a39504

Please sign in to comment.