prevent bug where sometimes logging exceptions would through another exception