guix-patches
[Top][All Lists]
Advanced

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

[bug#27654] [PATCH] base: Report evaluation error.


From: Ludovic Courtès
Subject: [bug#27654] [PATCH] base: Report evaluation error.
Date: Wed, 12 Jul 2017 14:15:30 +0200
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/25.2 (gnu/linux)

Howdy!

Mathieu Othacehe <address@hidden> skribis:

> * src/cuirass/base.scm (evaluate): Report an error in eof-object? is true on
>   data read from port. Otherwise, suppose that data are correct and keep thins
>   going.
> ---
>  src/cuirass/base.scm | 8 +++++++-
>  1 file changed, 7 insertions(+), 1 deletion(-)
>
> diff --git a/src/cuirass/base.scm b/src/cuirass/base.scm
> index f5f80b3..5e0cb0d 100644
> --- a/src/cuirass/base.scm
> +++ b/src/cuirass/base.scm
> @@ -136,7 +136,13 @@ directory and the sha1 of the top level commit in this 
> directory."
>                             (%package-cachedir)
>                             (object->string spec)
>                             (%package-database)))
> -         (jobs (read port)))
> +         (jobs (match (read port)
> +                 ;; If an error occured during evaluation report it,
> +                 ;; otherwise, suppose that data read from port are
> +                 ;; correct and keep things going.
> +                 ((? eof-object?)
> +                  (error "Could not evaluate specifications.\n"))
> +                 (data data))))

While we’re at it, let’s avoid ‘error’ altogether (‘error’ raises a
‘misc-error’ exception, which is not very helpful.)

What about declaring a specific SRFI-35 error condition type for
evaluation errors, and then raising it (with SRFI-34) here?  (If you’re
not familiar with SRFI-3[45], there are examples of it in the (guix *)
modules.)

Thanks,
Ludo’.





reply via email to

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