Throw runtime exception in shutdown hook