From 4ae7559fd62c03a800b010c228639f18b9f58006 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ludovic=20Court=C3=A8s?= Date: Tue, 7 Apr 2015 22:27:45 +0200 Subject: 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. --- gnu/packages.scm | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) (limited to 'gnu') 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)))) -- cgit v1.2.3