summary refs log tree commit diff
path: root/gnu
diff options
context:
space:
mode:
authorLudovic Courtès <ludo@gnu.org>2015-04-07 22:27:45 +0200
committerLudovic Courtès <ludo@gnu.org>2015-04-07 22:28:36 +0200
commit4ae7559fd62c03a800b010c228639f18b9f58006 (patch)
tree70b5a9f9f214993fdad29018ed10835a951090d0 /gnu
parent1151f6aeae281ae391f925f5cee086f1c2a0728a (diff)
downloadguix-4ae7559fd62c03a800b010c228639f18b9f58006.tar.gz
gnu: Emit a warning when a package module cannot be loaded.
* guix/ui.scm (warn-about-load-error): New procedure.
* gnu/packages.scm (package-modules): Wrap 'resolve-interface' call in
  'catch #t', and call 'warn-about-load-error' in handler.
Diffstat (limited to 'gnu')
-rw-r--r--gnu/packages.scm12
1 files changed, 9 insertions, 3 deletions
diff --git a/gnu/packages.scm b/gnu/packages.scm
index 57a3e21bd6..2216c0df8c 100644
--- a/gnu/packages.scm
+++ b/gnu/packages.scm
@@ -160,9 +160,15 @@ Optionally, narrow the search to SUB-DIRECTORY."
     (string-length directory))
 
   (filter-map (lambda (file)
-                (let ((file (substring file prefix-len)))
-                  (false-if-exception
-                   (resolve-interface (file-name->module-name file)))))
+                (let* ((file   (substring file prefix-len))
+                       (module (file-name->module-name file)))
+                  (catch #t
+                    (lambda ()
+                      (resolve-interface module))
+                    (lambda args
+                      ;; Report the error, but keep going.
+                      (warn-about-load-error module args)
+                      #f))))
               (scheme-files (if sub-directory
                                 (string-append directory "/" sub-directory)
                                 directory))))