attach status code to error object