catch and handle a shutdown exception.