output any caught error before throwing