top level exception handler