Invoke the callback with an error if the request object passed to an api call is invalid.