/// <summary>
        ///     Constructs an instance of exception.
        /// </summary>
        public ErrorCallbackApiException(Uri uri, PlatronError error) : base(error.Description)
        {
            Ensure.ArgumentNotNull(uri, nameof(uri));
            Ensure.ArgumentNotNull(error, nameof(error));

            Uri = uri;
            Error = error;
        }
        /// <summary>
        ///     Constructs an instance of exception.
        /// </summary>
        public ErrorCallbackApiException(Uri uri, PlatronError error) : base(error.Description)
        {
            Ensure.ArgumentNotNull(uri, nameof(uri));
            Ensure.ArgumentNotNull(error, nameof(error));

            Uri   = uri;
            Error = error;
        }
Ejemplo n.º 3
0
        public ErrorApiException(PlatronError error, IHttpResponse httpResponse)
            : base(error.Description)
        {
            Ensure.ArgumentNotNull(error, nameof(error));
            Ensure.ArgumentNotNull(httpResponse, nameof(httpResponse));

            Error        = error;
            HttpResponse = httpResponse;
        }
        public ErrorApiException(PlatronError error, IHttpResponse httpResponse)
            : base(error.Description)
        {
            Ensure.ArgumentNotNull(error, nameof(error));
            Ensure.ArgumentNotNull(httpResponse, nameof(httpResponse));

            Error = error;
            HttpResponse = httpResponse;
        }
Ejemplo n.º 5
0
        public CallbackResponse ReturnError(ResultUrlRequest request, PlatronError error)
        {
            Ensure.ArgumentNotNull(error, nameof(error));

            var plain = new PlainErrorWithCodeResponse
            {
                Status = ResponseKnownStatuses.Error,
                ErrorDescription = error.Description,
                ErrorCode = (int)error.Code
            };
            return _callback.EncodeResponse(new ApiCallbackResponse(request.Uri, plain));
        }
Ejemplo n.º 6
0
        public CallbackResponse ReturnError(ResultUrlRequest request, PlatronError error)
        {
            Ensure.ArgumentNotNull(error, nameof(error));

            var plain = new PlainErrorWithCodeResponse
            {
                Status           = ResponseKnownStatuses.Error,
                ErrorDescription = error.Description,
                ErrorCode        = (int)error.Code
            };

            return(_callback.EncodeResponse(new ApiCallbackResponse(request.Uri, plain)));
        }