In Python, one can use try statement to catch error, error can be stored asdata.
Can plpgsql catch and return error as data or a data table?
Regards, David