This is the mail archive of the guile@sourceware.cygnus.com mailing list for the Guile project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: scm_cur_loadp in an error hander


Keisuke Nishida <kxn30@po.cwru.edu> writes:

> I would like to display some file information in my application
> if an error occured during file loading.  I used scm_internal_catch
> and defined the error hander like this:

Try using scm_internal_stack_catch instead.

It will store information about the error which you can retrieve with

  scm_fluid_ref (SCM_CDR (scm_the_last_stack_fluid))

You can, for example, pass this information to:

SCM_DEFINE (scm_display_error, "display-error", 6, 0, 0,
           (SCM stack, SCM port, SCM subr, SCM message, SCM args, SCM rest),

(you get the last four args as argument to your error handler)

scm_display_error will display filename and position information.

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]