From mboxrd@z Thu Jan 1 00:00:00 1970 Path: main.gmane.org!not-for-mail From: prj@po.cwru.edu (Paul Jarc) Newsgroups: gmane.lisp.guile.user Subject: Re: reporting 'system-error informatively Date: Mon, 21 Oct 2002 14:36:00 -0400 Organization: What did you have in mind? A short, blunt, human pyramid? Sender: guile-user-admin@gnu.org Message-ID: References: <87r8ekx03e.fsf@zagadka.ping.de> <873cqzx33b.fsf@zagadka.ping.de> NNTP-Posting-Host: main.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: main.gmane.org 1035225432 27745 80.91.224.249 (21 Oct 2002 18:37:12 GMT) X-Complaints-To: usenet@main.gmane.org NNTP-Posting-Date: Mon, 21 Oct 2002 18:37:12 +0000 (UTC) Return-path: Original-Received: from monty-python.gnu.org ([199.232.76.173]) by main.gmane.org with esmtp (Exim 3.35 #1 (Debian)) id 183hQM-0007Cq-00 for ; Mon, 21 Oct 2002 20:37:11 +0200 Original-Received: from localhost ([127.0.0.1] helo=monty-python.gnu.org) by monty-python.gnu.org with esmtp (Exim 4.10) id 183hQd-0002Am-00; Mon, 21 Oct 2002 14:37:27 -0400 Original-Received: from list by monty-python.gnu.org with tmda-scanned (Exim 4.10) id 183hPN-0008I7-00 for guile-user@gnu.org; Mon, 21 Oct 2002 14:36:09 -0400 Original-Received: from mail by monty-python.gnu.org with spam-scanned (Exim 4.10) id 183hPJ-0008DB-00 for guile-user@gnu.org; Mon, 21 Oct 2002 14:36:08 -0400 Original-Received: from multivac.student.cwru.edu ([129.22.96.25] helo=multivac.cwru.edu) by monty-python.gnu.org with smtp (Exim 4.10) id 183hPI-00088i-00 for guile-user@gnu.org; Mon, 21 Oct 2002 14:36:05 -0400 Original-Received: (qmail 23256 invoked by uid 500); 21 Oct 2002 18:36:22 -0000 Original-To: guile-user@gnu.org In-Reply-To: <873cqzx33b.fsf@zagadka.ping.de> (Marius Vollmer's message of "21 Oct 2002 16:45:44 +0200") Mail-Copies-To: nobody Mail-Followup-To: guile-user@gnu.org Original-Lines: 30 User-Agent: Gnus/5.090008 (Oort Gnus v0.08) Emacs/21.2 (i686-pc-linux-gnu) Errors-To: guile-user-admin@gnu.org X-BeenThere: guile-user@gnu.org X-Mailman-Version: 2.0.11 Precedence: bulk List-Help: List-Post: List-Subscribe: , List-Id: General Guile related discussions List-Unsubscribe: , List-Archive: Xref: main.gmane.org gmane.lisp.guile.user:1255 X-Report-Spam: http://spam.gmane.org/gmane.lisp.guile.user:1255 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