Actually looks like a pretty standard approach for SQL databases. The SQLSTATE stuff is supported by Postgress, MySQL, MariaDB, SQL Server, surfaced by ODBC, DB2, etc. It allows a query or procedure to return errors and/or informational messages. An error indicates processing could not complete, and informational message may, for example, warn of data truncation but allow the task to finish.
"If you don't fail at least 90 percent of the time, you're not aiming high enough." Alan Kay.