diff --git a/module/VuFind/src/VuFind/Bootstrap.php b/module/VuFind/src/VuFind/Bootstrap.php
index bc7ed76a8f9dcf3db9cfd7591dba78004af2a56b..c3720110bb08c5c89376b8727581181681379d0a 100644
--- a/module/VuFind/src/VuFind/Bootstrap.php
+++ b/module/VuFind/src/VuFind/Bootstrap.php
@@ -290,6 +290,7 @@ class Bootstrap
             $viewModel->setVariable('userLang', $language);
             $viewModel->setVariable('allLangs', $config->Languages);
         };
+        $this->events->attach('dispatch.error', $callback, 9000);
         $this->events->attach('dispatch', $callback, 9000);
     }
 
@@ -317,6 +318,7 @@ class Bootstrap
             $theme = new ThemeInitializer($config, $event);
             $theme->init();
         };
+        $this->events->attach('dispatch.error', $callback, 10000);
         $this->events->attach('dispatch', $callback, 10000);
     }