Changes between Version 3 and Version 10 of Ticket #9640

09/12/13 19:42:22 (8 years ago)

The latest patch does everything that I think it should do. I hope it is reasonably self-explanatory. A few remarks:

  • The error text is now passed to PariError and can be accessed using PariError.errtext(); is is not printed automatically. Using this text to improve messages like PariError: (15) will probably have to wait until another ticket. (Edit: user errors are an exception, since they are converted into RuntimeError; here we append the error text to the currently used "PARI user exception".)
  • There is no problem with PARI sending escape sequences for colours in error messages; this is disabled by default.
  • The printing of a possible extra newline before the error message is easily avoided using pari_set_last_newline(1).
  • The callback functions are now Cython functions in the new file pari_error.pyx. It is important that this does not include pari_err.pxi; because of the way Cython imports functions, pari_err.pxi and pari_err.h use function pointers with the same names as the functions defined in pari_error.pyx.


  • Ticket #9640

    • Property Status changed from new to needs_review
    • Property Authors changed from Jeroen Demeyer to Peter Bruin
    • Property Cc jdemeyer added
    • Property Milestone changed from sage-5.11 to sage-5.12
  • Ticket #9640 – Description

    v3 v10  
    8 Using a mechanism similar to #9636, it should be possible to catch the full text of the exception and use it to throw {{{PariError}}}.  We should change to using {{{cb_pari_handle_exception()}}} instead of {{{err_catch()}}} to catch PARI exceptions.
     8This ticket does the following:
    10 Dependencies: #10115, #9893, #9678
     10- Use {{{cb_pari_handle_exception()}}} instead of {{{err_catch()}}} to catch PARI exceptions.
     12- Using a mechanism similar to #9636, catch the full text of the exception and pass it to {{{PariError}}}.  (It is not printed automatically, but can be accessed via `PariError.errtext()`.)
     14Apply: [attachment:9640-pari_error_callbacks.patch]