[ << ] | [ < ] | [ Up ] | [ > ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
6.13.9 Procedures for Signaling Errors
Guile provides a set of convenience procedures for signaling error conditions that are implemented on top of the exception primitives just described.
- Scheme Procedure: error msg arg …
Raise an error with key
misc-error
and a message constructed by displaying msg and writing arg ....
- Scheme Procedure: scm-error key subr message args data
- C Function: scm_error_scm (key, subr, message, args, data)
Raise an error with key key. subr can be a string naming the procedure associated with the error, or
#f
. message is the error message string, possibly containing~S
and~A
escapes. When an error is reported, these are replaced by formatting the corresponding members of args:~A
(was%s
in older versions of Guile) formats usingdisplay
and~S
(was%S
) formats usingwrite
. data is a list or#f
depending on key: if key issystem-error
then it should be a list containing the Unixerrno
value; If key issignal
then it should be a list containing the Unix signal number; If key isout-of-range
orwrong-type-arg
, it is a list containing the bad value; otherwise it will usually be#f
.
- Scheme Procedure: strerror err
- C Function: scm_strerror (err)
Return the Unix error message corresponding to err, an integer
errno
value.When
setlocale
has been called (see section Locales), the message is in the language and charset ofLC_MESSAGES
. (This is done by the C library.)
- syntax: false-if-exception expr
Returns the result of evaluating its argument; however if an exception occurs then
#f
is returned instead.
[ << ] | [ < ] | [ Up ] | [ > ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
This document was generated on April 20, 2013 using texi2html 5.0.