@dolittle/sdk.artifacts
Version:
Dolittle is a decentralized, distributed, event-driven microservice platform built to harness the power of events.
23 lines • 1.95 kB
JavaScript
;
// Copyright (c) Dolittle. All rights reserved.
// Licensed under the MIT license. See LICENSE file in the project root for full license information.
Object.defineProperty(exports, "__esModule", { value: true });
exports.CannotHaveMultipleTypesAssociatedWithKey = void 0;
const rudiments_1 = require("@dolittle/rudiments");
/**
* The exception that gets thrown when attempting to associate multiple types with a key in a {@link TypeMap}.
*/
class CannotHaveMultipleTypesAssociatedWithKey extends rudiments_1.Exception {
/**
* Initialises a new instance of the {@link CannotHaveMultipleTypesAssociatedWithKey} class.
* @param {any} key - The key that was already associated with a type.
* @param {Constructor} type - The type that was attempted to associate with.
* @param {Constructor} associatedType - The type that the key was already associated with.
* @param {Constructor} keyType - The type of the association key.
*/
constructor(key, type, associatedType, keyType) {
super(`${keyType.name} '${type.name}' cannot be associated with ${type.name} because it is already associated with ${associatedType.name}.`);
}
}
exports.CannotHaveMultipleTypesAssociatedWithKey = CannotHaveMultipleTypesAssociatedWithKey;
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiQ2Fubm90SGF2ZU11bHRpcGxlVHlwZXNBc3NvY2lhdGVkV2l0aEtleS5qcyIsInNvdXJjZVJvb3QiOiIuLi8iLCJzb3VyY2VzIjpbIk1hcHBpbmdzL0Nhbm5vdEhhdmVNdWx0aXBsZVR5cGVzQXNzb2NpYXRlZFdpdGhLZXkudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IjtBQUFBLCtDQUErQztBQUMvQyxxR0FBcUc7OztBQUVyRyxtREFBZ0Q7QUFLaEQ7O0dBRUc7QUFDSCxNQUFhLHdDQUF5QyxTQUFRLHFCQUFTO0lBQ25FOzs7Ozs7T0FNRztJQUNILFlBQVksR0FBUSxFQUFFLElBQXNCLEVBQUUsY0FBZ0MsRUFBRSxPQUF5QjtRQUNyRyxLQUFLLENBQUMsR0FBRyxPQUFPLENBQUMsSUFBSSxLQUFLLElBQUksQ0FBQyxJQUFJLCtCQUErQixJQUFJLENBQUMsSUFBSSwwQ0FBMEMsY0FBYyxDQUFDLElBQUksR0FBRyxDQUFDLENBQUM7SUFDakosQ0FBQztDQUNKO0FBWEQsNEZBV0MifQ==