using System;
using System.Collections.Generic;
using System.ComponentModel.Composition;
using System.Configuration;
using System.Runtime.Serialization;
using Microsoft.Http;
using System.Runtime.Serialization.Json;
publicclass RestServiceUtil
{
publicstaticvoid HandleHTTPErrorCode(HttpResponseMessage response)
{
if (response.StatusCode == System.Net.HttpStatusCode.OK)
return;
if (response.StatusCode == System.Net.HttpStatusCode.BadRequest)
{
string content = response.Content.ReadAsString().Replace("\"", "");
if (content.StartsWith("BRE_"))
thrownew ScrumFactory.Exceptions.BusinessRuleViolationException(content);
}
thrownew Exceptions.ServerErrorException();
}
}