better logging when exceptions