pub fn map_pg_error(err: &Error, context: &str) -> TargetErrorExpand description
Maps a tokio_postgres::Error to the proper TargetError variant.
Connection-class errors (SQLSTATE 08, closed connection, IO) become
NotConnected so the queue store retains the payload for replay.
Schema and constraint problems (SQLSTATE 23, 42) become Configuration
so they are surfaced to the operator without endless retry.
Transaction-rollback errors (SQLSTATE class 40, e.g. serialization failure
or deadlock) become Timeout so they are retried transiently.