UNPKG

@dolittle/sdk.artifacts

Version:

Dolittle is a decentralized, distributed, event-driven microservice platform built to harness the power of events.

23 lines 1.9 kB
"use strict"; // 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.CannotHaveMultipleKeysAssociatedWithType = void 0; const rudiments_1 = require("@dolittle/rudiments"); /** * The exception that gets thrown when attempting to associate multiple keys with a type in a {@link TypeMap}. */ class CannotHaveMultipleKeysAssociatedWithType extends rudiments_1.Exception { /** * Initialises a new instance of the {@link CannotHaveMultipleKeysAssociatedWithType} class. * @param {Constructor} type - The type that was already associated with a key. * @param {any} key - The key that was attempted to associate with. * @param {any} associatedKey - The key that the type was already associated with. * @param {Constructor} keyType - The type of the association key. */ constructor(type, key, associatedKey, keyType) { super(`'${type.name}' cannot be associated with ${keyType.name} ${key} because it is already associated with ${associatedKey}.`); } } exports.CannotHaveMultipleKeysAssociatedWithType = CannotHaveMultipleKeysAssociatedWithType; //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiQ2Fubm90SGF2ZU11bHRpcGxlS2V5c0Fzc29jaWF0ZWRXaXRoVHlwZS5qcyIsInNvdXJjZVJvb3QiOiIuLi8iLCJzb3VyY2VzIjpbIk1hcHBpbmdzL0Nhbm5vdEhhdmVNdWx0aXBsZUtleXNBc3NvY2lhdGVkV2l0aFR5cGUudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IjtBQUFBLCtDQUErQztBQUMvQyxxR0FBcUc7OztBQUVyRyxtREFBZ0Q7QUFLaEQ7O0dBRUc7QUFDSCxNQUFhLHdDQUF5QyxTQUFRLHFCQUFTO0lBQ25FOzs7Ozs7T0FNRztJQUNILFlBQVksSUFBc0IsRUFBRSxHQUFRLEVBQUUsYUFBa0IsRUFBRSxPQUF5QjtRQUN2RixLQUFLLENBQUMsSUFBSSxJQUFJLENBQUMsSUFBSSwrQkFBK0IsT0FBTyxDQUFDLElBQUksSUFBSSxHQUFHLDBDQUEwQyxhQUFhLEdBQUcsQ0FBQyxDQUFDO0lBQ3JJLENBQUM7Q0FDSjtBQVhELDRGQVdDIn0=