guile-user
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: excpetion printing


From: Matt Wette
Subject: Re: excpetion printing
Date: Tue, 20 Apr 2021 18:18:13 -0700
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.7.1



On 4/20/21 5:43 PM, Matt Wette wrote:
Is there any error I can throw in Guile that I don't catch myself
but will result in a user-friendly error message at the top?  Not this:

Throw to key `misc' with args `("read-yaml-file" "file not found: ~S" ("demo1x.yml") #f)'.


I did get this:
yaml.scm:37:4: In procedure read-yaml-file:
ERROR:
  1. &message: "read-yaml-file: can't access file:demo1x.yml

using guile 3.0 from
(cond-expand

 (guile-3
  (use-modules (ice-9 exceptions))
  (define (file-not-found filename)
    (raise-exception
     (make-exception-with-message
      (string-append "read-yaml-file: can't access file:"
             filename)))))
 (else
  (define (file-not-found filename)
    (scm-error 'misc "read-yaml-file"
           "file not found: ~S" (list filename) #f))))




reply via email to

[Prev in Thread] Current Thread [Next in Thread]