Pass error object to error_response method