Handle shutdown for more than just run-time errors