Example #1
0
 private void CheckResponseErrors(CoinoneSchema.BaseResponse baseResponse)
 {
     if (!baseResponse.result.Equals("success") && !baseResponse.errorCode.Equals("0"))
     {
         throw new ApiResponseException($"Error {baseResponse.errorCode}", this);
     }
 }
Example #2
0
        private void CheckResponseErrors(Dictionary <string, object> dictResponse)
        {
            object result    = String.Empty;
            object errorCode = String.Empty;

            if (!dictResponse.TryGetValue("result", out result))
            {
                throw new FormatException("Dictionary does not contain `result` key");
            }
            if (!dictResponse.TryGetValue("errorCode", out errorCode))
            {
                throw new FormatException("Dictionary does not contain `errorCode` key");
            }

            var baseResponse = new CoinoneSchema.BaseResponse()
            {
                result    = result.ToString(),
                errorCode = errorCode.ToString()
            };

            CheckResponseErrors(baseResponse);
        }