VIVO-673 Log throwables and re-throw them.
If a startup module throws an error, StartupManager will catch it only long enough to write it to the log, and then re-throw it.
This commit is contained in:
parent
2f68ddb8ee
commit
73f7604920
1 changed files with 10 additions and 0 deletions
|
@ -69,6 +69,9 @@ public class StartupManager implements ServletContextListener {
|
|||
} catch (Exception e) {
|
||||
ss.fatal(this, "Startup threw an unexpected exception.", e);
|
||||
log.error("Startup threw an unexpected exception.", e);
|
||||
} catch (Throwable t) {
|
||||
log.fatal("Startup threw an unexpected error.", t);
|
||||
throw t;
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -177,6 +180,9 @@ public class StartupManager implements ServletContextListener {
|
|||
ss.listenerExecuted(listener);
|
||||
} catch (Exception e) {
|
||||
ss.fatal(listener, "Threw unexpected exception", e);
|
||||
} catch (Throwable t) {
|
||||
log.fatal(listener + " Threw unexpected error", t);
|
||||
throw t;
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -214,6 +220,10 @@ public class StartupManager implements ServletContextListener {
|
|||
} catch (Exception e) {
|
||||
log.error("Unexpected exception from contextDestroyed() on '"
|
||||
+ listener.getClass().getName() + "'", e);
|
||||
} catch (Throwable t) {
|
||||
log.fatal("Unexpected error from contextDestroyed() on '"
|
||||
+ listener.getClass().getName() + "'", t);
|
||||
throw t;
|
||||
}
|
||||
}
|
||||
log.info("Called 'contextDestroyed' on all listeners.");
|
||||
|
|
Loading…
Add table
Reference in a new issue