Catch error, copied from nyc