I am quite new to Julia and I suspect my question is probably rather about how to access/analyze data type/structure.

Using LibPQ, execute is throwing an exception exc.

typeof(exc) is LibPQ.Errors.PQResultError{LibPQ.Errors.C22,LibPQ.Errors.E22001}

exc is LibPQ.Errors.StringDataRightTruncation(“ERROR: value too long for type character varying(10)\n”)

I do understand what the error means (INSERT INTO where the value of string in the column is larger that allowed 10 characters). But I want to analyze/parse the error programatically and properly indicate to the caller what went wrong.

How to analyze/parse this exc variable? What would be the proper condition to determine that it is LibPQ.Errors.StringDataRightTruncation? And how could I access/parse that string “ERROR: value too long for type character varying(10)\n”?

Thank you,