tlocke / pg8000

A Pure-Python PostgreSQL Driver
BSD 3-Clause "New" or "Revised" License
515 stars 46 forks source link

Raises InterfaceError rather then DatabaseError when database becomes unvailable. #79

Closed bigcat88 closed 3 years ago

bigcat88 commented 3 years ago

I shutdown database during my code test and got: InterfaceError: network error on read Maybe it is more correct to raise one of these:

OperationalError Exception raised for errors that are related to the database's operation and not necessarily under the control of the programmer, e.g. an unexpected disconnect occurs, the data source name is not found, a transaction could not be processed, a memory allocation error occurred during processing, etc. It must be a subclass of DatabaseError.

DatabaseError Exception raised for errors that are related to the database. It must be a subclass of Error.