RoutineRaiseException
Exception thrown when a PL/pgSQL routine raises an error of its own, through RAISE EXCEPTION.
This is the database saying no on purpose: a business rule expressed where the data is, rather than a routine that turned out to be broken. Those are RoutineAssertionException and are a separate type precisely so the two can be handled apart.
There is no reason enum here because there is nothing to tell apart. A plain RAISE EXCEPTION reports P0001; P0000 is reachable only by asking for it - RAISE ... USING ERRCODE = 'plpgsql_error' - so it is another deliberate raise rather than an unclassified failure. Which one it was is sqlState, and what it was about is dbMessage.
RAISE EXCEPTION ... USING ERRCODE reaching further than P0, on the other hand, leaves this class entirely: ERRCODE = '23505' is routed by the code it names and arrives as a ConstraintViolationException.
Parameters
The SQL state code returned by the database.
The original error message from the database server.
Properties
Where this happened, innermost first, appended to by each layer as the exception unwinds. It is on the base class for the same reason queryContext is: adding to it is the only thing a frame can do to an exception without replacing it, and replacing one costs the type the caller catches on - a ConstraintViolationException restated as something else stops being the failure a retry looks for. A mapper walking a nested composite appends the attribute it was on, a transaction plan the step and parameter it was resolving. Rendered reversed, outermost first, so PATH: step 1 -> parameter 'name' -> map #1 reads from the plan down to the lambda.
The context of the query that resulted in this exception, if applicable.
The raw error message received from the database, if applicable.