예제 #1
0
        private static async Task CheckError(HttpResponseMessage response)
        {
            if (response.StatusCode != HttpStatusCode.OK &&
                response.StatusCode != HttpStatusCode.Created &&
                response.StatusCode != HttpStatusCode.Accepted &&
                response.StatusCode != HttpStatusCode.NonAuthoritativeInformation &&
                response.StatusCode != HttpStatusCode.NoContent)
            {
                var mes = await response.Content.ReadAsStringAsync();

                var apiError = BacklogApiError.Decode(mes);
                throw new BacklogApiException("backlog api request failed.", (int)response.StatusCode, apiError);
            }
        }
예제 #2
0
 public BacklogApiException(string message, int statusCode, BacklogApiError apiError) : base(message)
 {
     this.StatusCode      = statusCode;
     this.BacklogApiError = apiError;
 }