61 lines
2.2 KiB
JavaScript
61 lines
2.2 KiB
JavaScript
"use strict";
|
|
// Copyright 2022 DeepL SE (https://www.deepl.com)
|
|
// Use of this source code is governed by an MIT
|
|
// license that can be found in the LICENSE file.
|
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
exports.ArgumentError = exports.DocumentDeminificationError = exports.DocumentMinificationError = exports.DocumentNotReadyError = exports.GlossaryNotFoundError = exports.DocumentTranslationError = exports.ConnectionError = exports.TooManyRequestsError = exports.QuotaExceededError = exports.AuthorizationError = exports.DeepLError = void 0;
|
|
class DeepLError extends Error {
|
|
constructor(message, error) {
|
|
super(message);
|
|
this.message = message;
|
|
this.error = error;
|
|
}
|
|
}
|
|
exports.DeepLError = DeepLError;
|
|
class AuthorizationError extends DeepLError {
|
|
}
|
|
exports.AuthorizationError = AuthorizationError;
|
|
class QuotaExceededError extends DeepLError {
|
|
}
|
|
exports.QuotaExceededError = QuotaExceededError;
|
|
class TooManyRequestsError extends DeepLError {
|
|
}
|
|
exports.TooManyRequestsError = TooManyRequestsError;
|
|
class ConnectionError extends DeepLError {
|
|
constructor(message, shouldRetry, error) {
|
|
super(message, error);
|
|
this.shouldRetry = shouldRetry || false;
|
|
}
|
|
}
|
|
exports.ConnectionError = ConnectionError;
|
|
class DocumentTranslationError extends DeepLError {
|
|
constructor(message, handle, error) {
|
|
super(message, error);
|
|
this.documentHandle = handle;
|
|
}
|
|
}
|
|
exports.DocumentTranslationError = DocumentTranslationError;
|
|
class GlossaryNotFoundError extends DeepLError {
|
|
}
|
|
exports.GlossaryNotFoundError = GlossaryNotFoundError;
|
|
class DocumentNotReadyError extends DeepLError {
|
|
}
|
|
exports.DocumentNotReadyError = DocumentNotReadyError;
|
|
/**
|
|
* Error thrown if an error occurs during the minification phase.
|
|
* @see DocumentMinifier.minifyDocument
|
|
*/
|
|
class DocumentMinificationError extends DeepLError {
|
|
}
|
|
exports.DocumentMinificationError = DocumentMinificationError;
|
|
/**
|
|
* Error thrown if an error occurs during the deminification phase.
|
|
* @see DocumentMinifier.deminifyDocument
|
|
*/
|
|
class DocumentDeminificationError extends DeepLError {
|
|
}
|
|
exports.DocumentDeminificationError = DocumentDeminificationError;
|
|
class ArgumentError extends DeepLError {
|
|
}
|
|
exports.ArgumentError = ArgumentError;
|