ALMRestClient.ALMClient.ThrowExceptionIfNecessary C# (CSharp) Method

ThrowExceptionIfNecessary() private method

Throws an exception with a standard message when HideCustomExceptions is false
private ThrowExceptionIfNecessary ( IRestResponse response, string location ) : void
response IRestResponse The response that caused the error
location string The location of the error
return void
        private void ThrowExceptionIfNecessary(IRestResponse response, string location)
        {
            if (HideCustomExceptions == false)
            {
                throw new ALMClientException(response.StatusCode, string.Format("Error in {0} {1}", location, response.ErrorMessage), response.Content);
            }
        }

Same methods

ALMClient::ThrowExceptionIfNecessary ( IRestResponse response, string location, string customMessage ) : void