translateTermination

The exception for a FATAL or PANIC the server sent in a session that was open.

Chosen by severity before SQLSTATE, because the severity is what decides where the caller stands: the server closes the connection behind either one, so whatever the code says, the session is over - a FATAL 57P01 is not a server in trouble, and a FATAL 40001 from a standby's recovery conflict is not a serialization failure to retry on the same session. The code then names why, for the causes an application would tell apart, and SessionTerminatedExceptionReason.UNKNOWN carries the rest with the code intact.

Not for login, where there is no session yet to end: a FATAL there is translateRefusal's.

Return

The exception to raise, carrying the server's message, SQLSTATE and detail fields.

Parameters

errorMsg

The ErrorResponse the server sent, severity FATAL or PANIC.