Functions for handling PARI errors

AUTHORS:

exception sage.libs.pari.handle_error.PariError

Bases: exceptions.RuntimeError

Error raised by PARI

errdata()

Return the error data (a t_ERROR gen) corresponding to this error.

EXAMPLES:

sage: try:
....:     pari(Mod(2,6))^-1
....: except PariError as e:
....:     E = e.errdata()
sage: E
error("impossible inverse in Fp_inv: Mod(2, 6).")
sage: E.component(2)
Mod(2, 6)
errnum()

Return the PARI error number corresponding to this exception.

EXAMPLES:

sage: try:
....:     pari('1/0')
....: except PariError as err:
....:     print(err.errnum())
31
errtext()

Return the message output by PARI when this error occurred.

EXAMPLE:

sage: try:
....:     pari('pi()')
....: except PariError as e:
....:     print(e.errtext())
not a function in function call