diffusion
Version:
Diffusion JavaScript client
378 lines (377 loc) • 11.4 kB
JavaScript
"use strict";
/* eslint max-classes-per-file: 0 */
var __extends = (this && this.__extends) || (function () {
var extendStatics = function (d, b) {
extendStatics = Object.setPrototypeOf ||
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
return extendStatics(d, b);
};
return function (d, b) {
if (typeof b !== "function" && b !== null)
throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
extendStatics(d, b);
function __() { this.constructor = d; }
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
};
})();
Object.defineProperty(exports, "__esModule", { value: true });
exports.InternalError = exports.IllegalStateError = exports.RetryLimitError = exports.SchemaParseError = exports.SchemaViolationError = exports.InvalidFilterError = exports.OutOfBoundsError = exports.IllegalArgumentError = exports.SessionError = exports.IOError = exports.InvalidDataError = exports.AssertionError = exports.RuntimeError = exports.NullValueError = void 0;
/**
* An error that signals that a `null` or `undefined` value was encountered.
*/
var NullValueError = /** @class */ (function (_super) {
__extends(NullValueError, _super);
/**
* The constructor creates NullValueError objects.
* @param message The error message
*/
function NullValueError(message) {
return _super.call(this, message) || this;
}
/**
* Get the error type
*/
NullValueError.prototype.getType = function () {
return NullValueError.type;
};
/**
* The `null_value_error` error type
*/
NullValueError.type = 'null_value_error';
return NullValueError;
}(Error));
exports.NullValueError = NullValueError;
/**
* An error that signals a runtime error.
*/
var RuntimeError = /** @class */ (function (_super) {
__extends(RuntimeError, _super);
/**
* The constructor creates RuntimeError objects.
* @param message The error message
*/
function RuntimeError(message, cause) {
var _this = _super.call(this, message) || this;
_this.cause = cause;
return _this;
}
/**
* Get the error type
*/
RuntimeError.prototype.getType = function () {
return RuntimeError.type;
};
/**
* The `runtime_error` error type
*/
RuntimeError.type = 'runtime_error';
return RuntimeError;
}(Error));
exports.RuntimeError = RuntimeError;
/**
* An error that is not expected to occur.
*/
var AssertionError = /** @class */ (function (_super) {
__extends(AssertionError, _super);
/**
* The constructor creates RuntimeError objects.
* @param message The error message
*/
function AssertionError(message) {
return _super.call(this, message) || this;
}
/**
* Get the error type
*/
AssertionError.prototype.getType = function () {
return AssertionError.type;
};
/**
* The `assertion_error` error type
*/
AssertionError.type = 'assertion_error';
return AssertionError;
}(Error));
exports.AssertionError = AssertionError;
/**
* An error that signals that invalid data was encountered.
*/
var InvalidDataError = /** @class */ (function (_super) {
__extends(InvalidDataError, _super);
/**
* The constructor creates InvalidDataError objects.
* @param message The error message
*/
function InvalidDataError(message) {
return _super.call(this, message) || this;
}
/**
* Get the error type
*/
InvalidDataError.prototype.getType = function () {
return InvalidDataError.type;
};
/**
* The `invalid_data_error` error type
*/
InvalidDataError.type = 'invalid_data_error';
return InvalidDataError;
}(Error));
exports.InvalidDataError = InvalidDataError;
/**
* An error that signals that an I/O error has occurred.
*/
var IOError = /** @class */ (function (_super) {
__extends(IOError, _super);
/**
* The constructor creates IOError objects.
* @param message The error message
*/
function IOError(message) {
return _super.call(this, message) || this;
}
/**
* Get the error type
*/
IOError.prototype.getType = function () {
return IOError.type;
};
/**
* The `io_error` error type
*/
IOError.type = 'io_error';
return IOError;
}(Error));
exports.IOError = IOError;
/**
* An error that is reported from a service call.
*/
var SessionError = /** @class */ (function (_super) {
__extends(SessionError, _super);
/**
* The constructor creates SessionError objects.
* @param message The error message
*/
function SessionError(message, cause) {
var _this = _super.call(this, message) || this;
_this.cause = cause;
return _this;
}
/**
* Get the error type
*/
SessionError.prototype.getType = function () {
return SessionError.type;
};
/**
* The `session_error` error type
*/
SessionError.type = 'session_error';
return SessionError;
}(Error));
exports.SessionError = SessionError;
/**
* An error that indicates that a function has been called with an illegal or
* inappropriate argument.
*/
var IllegalArgumentError = /** @class */ (function (_super) {
__extends(IllegalArgumentError, _super);
/**
* The constructor creates IllegalArgumentError objects.
* @param message The error message
*/
function IllegalArgumentError(message) {
return _super.call(this, message) || this;
}
/**
* Get the error type
*/
IllegalArgumentError.prototype.getType = function () {
return IllegalArgumentError.type;
};
/**
* The `illegal_argument_error` error type
*/
IllegalArgumentError.type = 'illegal_argument_error';
return IllegalArgumentError;
}(Error));
exports.IllegalArgumentError = IllegalArgumentError;
/**
* An error that indicates that the requested index is out of bounds.
*/
var OutOfBoundsError = /** @class */ (function (_super) {
__extends(OutOfBoundsError, _super);
/**
* The constructor creates OutOfBoundsError objects.
* @param message The error message
*/
function OutOfBoundsError(message) {
return _super.call(this, message) || this;
}
/**
* Get the error type
*/
OutOfBoundsError.prototype.getType = function () {
return OutOfBoundsError.type;
};
/**
* The `out_of_bounds_error` error type
*/
OutOfBoundsError.type = 'out_of_bounds_error';
return OutOfBoundsError;
}(Error));
exports.OutOfBoundsError = OutOfBoundsError;
/**
* An error that indicates that a filter expression is invalid.
*/
var InvalidFilterError = /** @class */ (function (_super) {
__extends(InvalidFilterError, _super);
/**
* The constructor creates InvalidFilterError objects.
* @param message The error message
*/
function InvalidFilterError(message, errors) {
var _this = _super.call(this, message) || this;
_this.errors = errors;
return _this;
}
/**
* Get the error type
*/
InvalidFilterError.prototype.getType = function () {
return InvalidFilterError.type;
};
/**
* The `invalid_filter_error` error type
*/
InvalidFilterError.type = 'invalid_filter_error';
return InvalidFilterError;
}(Error));
exports.InvalidFilterError = InvalidFilterError;
/**
* Indicates a problem that has occurred when building a schema.
*/
var SchemaViolationError = /** @class */ (function (_super) {
__extends(SchemaViolationError, _super);
/**
* The constructor creates SchemaViolationError objects.
* @param message The error message
*/
function SchemaViolationError(message) {
return _super.call(this, message) || this;
}
/**
* Get the error type
*/
SchemaViolationError.prototype.getType = function () {
return SchemaViolationError.type;
};
/**
* The `schema_violation_error` error type
*/
SchemaViolationError.type = 'schema_violation_error';
return SchemaViolationError;
}(Error));
exports.SchemaViolationError = SchemaViolationError;
/**
* Indicates a problem that has occurred when parsing a schema.
*/
var SchemaParseError = /** @class */ (function (_super) {
__extends(SchemaParseError, _super);
/**
* The constructor creates SchemaParseError objects.
* @param message The error message
*/
function SchemaParseError(message) {
return _super.call(this, message) || this;
}
/**
* Get the error type
*/
SchemaParseError.prototype.getType = function () {
return SchemaParseError.type;
};
/**
* The `schema_parse_error` error type
*/
SchemaParseError.type = 'schema_parse_error';
return SchemaParseError;
}(Error));
exports.SchemaParseError = SchemaParseError;
/**
* An error that indicates that a retry limit has been reached.
*/
var RetryLimitError = /** @class */ (function (_super) {
__extends(RetryLimitError, _super);
/**
* The constructor creates RetryLimitError objects.
* @param message The error message
*/
function RetryLimitError(message) {
return _super.call(this, message) || this;
}
/**
* Get the error type
*/
RetryLimitError.prototype.getType = function () {
return RetryLimitError.type;
};
/**
* The `retry_limit_error` error type
*/
RetryLimitError.type = 'retry_limit_error';
return RetryLimitError;
}(Error));
exports.RetryLimitError = RetryLimitError;
/**
* An error that indicates that a method has been called at an illegal or
* inappropriate time.
*/
var IllegalStateError = /** @class */ (function (_super) {
__extends(IllegalStateError, _super);
/**
* The constructor creates IllegalStateError objects.
* @param message The error message
*/
function IllegalStateError(message) {
return _super.call(this, message) || this;
}
/**
* Get the error type
*/
IllegalStateError.prototype.getType = function () {
return IllegalStateError.type;
};
/**
* The `illegal_state_error` error type
*/
IllegalStateError.type = 'illegal_state_error';
return IllegalStateError;
}(Error));
exports.IllegalStateError = IllegalStateError;
/**
* An error that indicates an error that is internal to the diffusion client.
*/
var InternalError = /** @class */ (function (_super) {
__extends(InternalError, _super);
/**
* The constructor creates InternalError objects.
* @param message The error message
*/
function InternalError(message) {
return _super.call(this, message) || this;
}
/**
* Get the error type
*/
InternalError.prototype.getType = function () {
return InternalError.type;
};
/**
* The `internal_error` error type
*/
InternalError.type = 'internal_error';
return InternalError;
}(Error));
exports.InternalError = InternalError;