PL/SQL get more specific error message for package compile error

Exapmle error:

cx_Oracle.DatabaseError: ORA-04063: package body "SAMPLE_PKG" has errors
ORA-06508: PL/SQL: could not find program unit being called: "SAMPLE_PKG"
ORA-06512: at line 1

Get more specific error message:

SQL> select * from all_errors



PLS-00103: Encountered the symbol ")" when expecting one of the following:

   <an identifier> <a double-quoted delimited-identifier>
   current delete exists prior
ERROR                103