wallee
Version:
TypeScript/JavaScript client for wallee
67 lines (66 loc) • 2.76 kB
JavaScript
;
/* tslint:disable */
/* eslint-disable */
/**
* Wallee AG TypeScript SDK
*
* This library allows to interact with the Wallee AG payment service.
*
* Copyright owner: Wallee AG
* Website: https://en.wallee.com
* Developer email: ecosystem-team@wallee.com
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
Object.defineProperty(exports, "__esModule", { value: true });
exports.ApiExceptionErrorCodes = void 0;
/**
* ResponseError Error Codes
*/
class ApiExceptionErrorCodes {
/**
* Checks if the given exception matches the specific error code.
* @param exception The exception to check
* @param code The error code to compare against
*/
static is(exception, code) {
return exception.response.status === code;
}
}
exports.ApiExceptionErrorCodes = ApiExceptionErrorCodes;
// This class represents possible HTTP error codes which can be sent by the API.
// This list corresponds to https://app-wallee.com/en-us/doc/api/web-service#_errors
// The request was not accepted often due to missing or invalid parameters
ApiExceptionErrorCodes.BAD_REQUEST = 400;
// The necessary authentication credentials are missing or incorrect
ApiExceptionErrorCodes.UNAUTHORIZED = 401;
// The application user is missing the required permissions
ApiExceptionErrorCodes.FORBIDDEN = 403;
// The requested resource was not found
ApiExceptionErrorCodes.NOT_FOUND = 404;
// The requested response format is not supported
ApiExceptionErrorCodes.NOT_ACCEPTABLE = 406;
// The request conflicts with another request often because of to optimistic locking
ApiExceptionErrorCodes.CONFLICT = 409;
// Too many operations in a bulk request
ApiExceptionErrorCodes.PAYLOAD_TOO_LARGE = 413;
// The request provides unsupported or invalid data
ApiExceptionErrorCodes.UNSUPPORTED_MEDIA_TYPE = 415;
// The pagination offset exceeds the limit
ApiExceptionErrorCodes.RANGE_NOT_SATISFIABLE = 416;
// The request is well-formed but contains semantic errors. Check the response body for details
ApiExceptionErrorCodes.UNPROCESSABLE_ENTITY = 422;
// Too many requests hit the API too quickly
ApiExceptionErrorCodes.TOO_MANY_REQUESTS = 429;
// An internal error occurred on the server
ApiExceptionErrorCodes.INTERNAL_SERVER_ERROR = 500;