Implement panic and recover for idetifying exit points.