This is the mail archive of the
guile@sourceware.cygnus.com
mailing list for the Guile project.
Re: scm_cur_loadp in an error hander
- To: Keisuke Nishida <kxn30 at po dot cwru dot edu>
- Subject: Re: scm_cur_loadp in an error hander
- From: Mikael Djurfeldt <mdj at mdj dot nada dot kth dot se>
- Date: 15 Mar 2000 03:53:33 +0100
- Cc: guile at sourceware dot cygnus dot com
- Cc: djurfeldt at nada dot kth dot se
- References: <m3n1o1axha.fsf@kei.cwru.edu>
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.