|
From: | Paul Jarc |
Subject: | Re: reporting 'system-error informatively |
Date: | Mon, 21 Oct 2002 14:36:00 -0400 |
User-agent: | Gnus/5.090008 (Oort Gnus v0.08) Emacs/21.2 (i686-pc-linux-gnu) |
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
[Prev in Thread] | Current Thread | [Next in Thread] |