parse server error messages (#543)

This commit adds a parser to the Postgres error message, providing better
error messages.

Implemented based in:
  https://www.postgresql.org/docs/12/protocol-error-fields.html

Signed-off-by: Sebastian Webber <sebastian@swebber.me>
This commit is contained in:
Sebastian Webber
2023-08-09 13:14:05 -03:00
committed by GitHub
parent 1cde74f05e
commit 9ab128579d
3 changed files with 308 additions and 6 deletions

View File

@@ -12,6 +12,7 @@ pub enum Error {
ProtocolSyncError(String),
BadQuery(String),
ServerError,
ServerMessageParserError(String),
ServerStartupError(String, ServerIdentifier),
ServerAuthError(String, ServerIdentifier),
BadConfig,