guide
Version:
Encrypted Globally Unique Identifier generator.
48 lines (37 loc) • 1.73 kB
JavaScript
;
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.UnexpectedResourceTypeNameValueError = exports.UnexpectedNamespaceValueError = exports.InvalidGuideError = exports.GuideError = undefined;
var _es6Error = require('es6-error');
var _es6Error2 = _interopRequireDefault(_es6Error);
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
/*:: import type {
GuidePayloadType
} from './types';*/ // @flow
class GuideError extends _es6Error2.default {}
exports.GuideError = GuideError;
class InvalidGuideError extends GuideError {
// eslint-disable-next-line no-unused-vars
constructor(guide /*: string*/) {
super('The input GUIDE cannot be decrypted.');
}
}
exports.InvalidGuideError = InvalidGuideError;
class UnexpectedNamespaceValueError extends InvalidGuideError {
// eslint-disable-next-line no-unused-vars
constructor(guide /*: string*/, expectedNamespace /*: string*/, expectedResourceTypeName /*: string*/, payload /*: GuidePayloadType*/) {
super(guide);
this.message = 'Decrypted GUIDE namespace does not match the expected namespace.';
}
}
exports.UnexpectedNamespaceValueError = UnexpectedNamespaceValueError;
class UnexpectedResourceTypeNameValueError extends InvalidGuideError {
// eslint-disable-next-line no-unused-vars
constructor(guide /*: string*/, expectedNamespace /*: string*/, expectedResourceTypeName /*: string*/, payload /*: GuidePayloadType*/) {
super(guide);
this.message = 'Decrypted GUIDE resource type name does not match the expected resource type name.';
}
}
exports.UnexpectedResourceTypeNameValueError = UnexpectedResourceTypeNameValueError;
//# sourceMappingURL=errors.js.map