Invoke a function if the response is bad