By default, use-package will attempts to catch and report errors that
occur during expansion of use-package declarations in your init file.
Customize the user option use-package-expand-minimally
to a
non-nil
value to disable this checking.
This behavior may be overridden locally using the :catch
keyword. If t
or nil
, it enables or disables catching
errors at load time. It can also be a function taking two arguments:
the keyword being processed at the time the error was encountered, and
the error object (as generated by condition-case
). For
example:
(use-package example ;; Note that errors are never trapped in the preface, since ;; doing so would hide definitions from the byte-compiler. :preface (message "I'm here at byte-compile and load time") :init (message "I'm always here at startup") :config (message "I'm always here after the package is loaded") (error "oops") ;; Don't try to (require 'example), this is just an example! :no-require t :catch (lambda (keyword err) (message (error-message-string err))))
Evaluating the above form will print these messages:
I'm here at byte-compile and load time I'm always here at startup Configuring package example... I'm always here after the package is loaded oops