export type ErrorxAdditionalOpts = { privateFields?: object; privateMessage?: string; fields?: object; skipLog?: boolean; cause?: Error | unknown; }; export type ErrorxBaseOpts = { message: string; code: string; httpErrorStatus: number; detailedErrorMessage?: string; }; export type ErrorxOpts = ErrorxBaseOpts & ErrorxAdditionalOpts; /** * Errorx is a custom error class that extends the native Error class. */ export declare class Errorx extends Error { code: string; httpErrorStatus: number; cause?: Error | unknown; detailedErrorMessage?: string; privateFields?: object; privateMessage?: string; fields?: object; skipLog?: boolean; constructor(opts: ErrorxOpts); } export declare class MultiErrorx extends Error { errors: Errorx[]; constructor(errors: Errorx[]); } /** * AuthErrorResponse (https://docs.commercetools.com/api/errors#autherrorresponse) * Represents errors related to authentication and authorization in a format conforming to the OAuth 2.0 specification. * { * "statusCode": 401, * "message": "invalid_token", * "errors": [ * { * "code": "invalid_token", * "message": "invalid_token" * } * ], * "error": "invalid_token" * } */ export declare class ErrorAuthErrorResponse extends Errorx { constructor(message?: string, additionalOpts?: ErrorxAdditionalOpts, code?: string); } /** * General (https://docs.commercetools.com/api/errors#general) * Returned when a server-side problem occurs. */ export declare class ErrorGeneral extends Errorx { constructor(msg?: string, additionalOpts?: ErrorxAdditionalOpts); } /** * MissingProjectKey * Missing the project key in the path. */ export declare class ErrorMissingProjectKey extends Errorx { constructor(additionalOpts?: ErrorxAdditionalOpts); } /** * InvalidJsonInput (https://docs.commercetools.com/api/errors#invalidjsoninput) * Returned when an invalid JSON input has been sent. Either the JSON is syntactically incorrect or does not conform to the expected shape (for example is missing a required field). * * The client application should validate the input according to the constraints described in the error message before sending the request. */ export declare class ErrorInvalidJsonInput extends Errorx { constructor(detailedErrorMessage?: string, additionalOpts?: ErrorxAdditionalOpts); } /** * InvalidOperation (https://docs.commercetools.com/api/errors#invalidoperation) * Returned when the resources involved in the request are not in a valid state for the operation. * * The client application should validate the constraints described in the error message before sending the request. */ export declare class ErrorInvalidOperation extends Errorx { constructor(message: string, additionalOpts?: ErrorxAdditionalOpts); } /** * InvalidField (https://docs.commercetools.com/api/errors#invalidfield) * Returned when a field has an invalid value. */ export declare class ErrorInvalidField extends Errorx { constructor(field: string, invalidValue: string, allowedValues: string, additionalOpts?: ErrorxAdditionalOpts); } /** * InternalConstraintViolated (https://docs.commercetools.com/api/errors#internalconstraintviolated) * Returned when certain API-specific constraints were not met. For example, the specified Discount Code was never applied and cannot be updated. */ export declare class ErrorInternalConstraintViolated extends Errorx { constructor(message: string, additionalOpts?: ErrorxAdditionalOpts); } /** * MoneyOverflow (https://docs.commercetools.com/api/errors#moneyoverflow) * Returned when a Money operation overflows the 64-bit integer range. See Money usage for more information. */ export declare class ErrorMoneyOverflow extends Errorx { constructor(limit: number, resourceTypeId: string, additionalOpts?: ErrorxAdditionalOpts); } /** * ObjectNotFound (https://docs.commercetools.com/api/errors#objectnotfound) * Returned when the requested resource was not found. */ export declare class ErrorObjectNotFound extends Errorx { constructor(resourceTypeId: string, id: string, additionalOpts?: ErrorxAdditionalOpts); } /** * InvalidField (https://docs.commercetools.com/api/errors#invalidfield) * Returned when a field has an invalid value. */ export declare class ErrorReferenceExists extends Errorx { constructor(resource: string, referencedBy?: string, additionalOpts?: ErrorxAdditionalOpts); } /** * ReferencedResourceNotFound (https://docs.commercetools.com/api/errors#referencedresourcenotfound) * Returned when a resource referenced by a Reference or a ResourceIdentifier could not be found. */ export declare class ErrorReferencedResourceNotFound extends Errorx { constructor(typeId: string, predicate: string, additionalOpts?: ErrorxAdditionalOpts); } /** * ReferencedResourceNotFound (https://docs.commercetools.com/api/errors#referencedresourcenotfound) * Returned when a resource referenced by a Reference or a ResourceIdentifier could not be found. */ export declare class ErrorRequiredField extends Errorx { constructor(field: string, additionalOpts?: ErrorxAdditionalOpts); } /** * SyntaxError (https://docs.commercetools.com/api/errors#syntaxerror) * Returned when a Discount predicate, API Extension predicate, or search query does not have the correct syntax. */ export declare class ErrorSyntaxError extends Errorx { constructor(fieldDefinition: string, additionalOpts?: ErrorxAdditionalOpts); } /** * ResourceNotFound (https://docs.commercetools.com/api/errors#resourcenotfound) * Returned when the resource addressed by the request URL does not exist. */ export declare class ErrorResourceNotFound extends Errorx { constructor(resourceId: string, additionalOpts?: ErrorxAdditionalOpts); } /** * ConcurrentModification (https://docs.commercetools.com/api/errors#concurrentmodification) * Returned when the request conflicts with the current state of the involved resources. Typically, the request attempts to modify a resource that is out of date (that is modified by another client since it was last retrieved). The client application should resolve the conflict (with or without involving the end-user) before retrying the request. */ export declare class ErrorConcurrentModification extends Errorx { constructor(resourceId: string, expectedVersion: number, currentVersion: number, additionalOpts?: ErrorxAdditionalOpts); } export declare class ErrorMissingAuthenticationInfo extends Errorx { constructor(additionalOpts?: ErrorxAdditionalOpts); }