Add response code and header when an error