/// <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;
        }
        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;
        }
        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));
        }
Beispiel #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)));
        }