unofficial mirror of guile-user@gnu.org 
 help / color / mirror / Atom feed
From: prj@po.cwru.edu (Paul Jarc)
Subject: Re: reporting 'system-error informatively
Date: Mon, 21 Oct 2002 14:36:00 -0400	[thread overview]
Message-ID: <m3bs5n8wrd.fsf@multivac.cwru.edu> (raw)
In-Reply-To: <873cqzx33b.fsf@zagadka.ping.de> (Marius Vollmer's message of "21 Oct 2002 16:45:44 +0200")

Thanks for the hints.  The following seems to do what I want; comments
welcome.

(debug-enable 'debug)

(define display-system-error
  (let ()
    (define (handler . args)
      (let ((proc-args
             (if (memq 'debug (debug-options-interface))
               (frame-arguments (stack-ref (make-stack #t handler) 0))
               '(unknown-arguments))))
        (display (cadr args))
        (write proc-args)
        (display ": ")
        (display (strerror (system-error-errno args)))
        (newline)
        (exit 100)))
    (lambda (thunk)
      (lazy-catch 'system-error
                  thunk
                  handler))))

(display-system-error
 (lambda ()
   (let ((path "doesnotexist"))
     (readlink path))))


paul


_______________________________________________
Guile-user mailing list
Guile-user@gnu.org
http://mail.gnu.org/mailman/listinfo/guile-user


  reply	other threads:[~2002-10-21 18:36 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2002-10-19 21:18 reporting 'system-error informatively Paul Jarc
2002-10-20 21:38 ` Marius Vollmer
2002-10-20 23:02   ` Daniel Skarda
2002-10-21 14:46     ` Marius Vollmer
2002-10-21  6:13   ` Paul Jarc
2002-10-21 14:45     ` Marius Vollmer
2002-10-21 18:36       ` Paul Jarc [this message]
2002-10-21 18:55       ` Neil Jerram

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/guile/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=m3bs5n8wrd.fsf@multivac.cwru.edu \
    --to=prj@po.cwru.edu \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).