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, string customMessage ) : void
response IRestResponse The response that caused the error
location string The location of the error
customMessage string A custom message descripting the error
return void
        private void ThrowExceptionIfNecessary(IRestResponse response, string location, string customMessage)
        {
            if (HideCustomExceptions == false)
            {
                throw new ALMClientException(response.StatusCode, string.Format("Error in {0}:{1} {2}", location, customMessage, response.ErrorMessage), response.Content);
            }
        }

Same methods

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