#pragma warning disable 1591 using System; using NAMESPACEPLACEHOLDER.Model; using Newtonsoft.Json; namespace NAMESPACEPLACEHOLDER.Client { class ExtApiException: ApiException { public int ErrorCode { get; } public int ServiceErrorCode { get; } public String OffensiveData { get; } public ExtApiException(ErrorResultObject ero): base(ero.errorCode, ero.errorMessage, ero) { ErrorCode = ero.errorCode; ServiceErrorCode = ero.serviceErrorCode; OffensiveData = ero.offensiveData; } public static ExceptionFactory ExtExceptionFactory = (methodName, response) => { var status = (int) response.StatusCode; if (status >= 400) { var ero = JsonConvert.DeserializeObject(response.RawContent); return new ExtApiException(ero); } return null; }; } } #pragma warning restore 1591