From 68ee3c942d281779eb7e44b04dd707ef1d3996cf Mon Sep 17 00:00:00 2001 From: Olof-Joachim Frahm Date: Tue, 2 Dec 2014 21:29:29 +0100 Subject: [PATCH] Catch errors while trying to compile plugins. A warning with the full error message will be printed and the original file `LOAD`ed instead. If the error isn't related to the `fasl` file output, then the `LOAD` should also throw an error, at which point the normal error handling would take place. --- src/config.lisp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/config.lisp b/src/config.lisp index 5260600..1d55c9c 100644 --- a/src/config.lisp +++ b/src/config.lisp @@ -53,7 +53,11 @@ (plugin-package (sym) (format nil "~:@(coleslaw-~A~)" sym))) (let ((file (plugin-path name))) - (load (compile-file file :verbose nil :print nil) :verbose t)) + (multiple-value-bind (output-file error) + (ignore-errors (compile-file file :verbose nil :print nil)) + (when error + (warn "Error while compiling plugin ~A: ~A.~%" name error)) + (load (or output-file file) :verbose t))) (let ((package (find-package (plugin-package name)))) (apply (find-symbol "ENABLE" package) args))))