UNPKG

@dolittle/sdk.projections

Version:

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

22 lines 1.77 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.ReadModelAlreadyDefinedForProjection = void 0; const rudiments_1 = require("@dolittle/rudiments"); /** * Exception that is thrown when you try to register a readmodel for a projection when its already defined. */ class ReadModelAlreadyDefinedForProjection extends rudiments_1.Exception { /** * Initialises a new instance of the {@link ReadModelAlreadyDefinedForProjection} class. * @param {ProjectionId} projectionId - The projection identifier. * @param {Constructor<any> | any} newReadModel - The readmodel type that was attempted to be registered. * @param {Constructor<any> | any} oldReadModel - The readmodel type that was already registered. */ constructor(projectionId, newReadModel, oldReadModel) { super(`Cannot assign ${newReadModel} to projection ${projectionId}. It is already associated with ${oldReadModel}`); } } exports.ReadModelAlreadyDefinedForProjection = ReadModelAlreadyDefinedForProjection; //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiUmVhZE1vZGVsQWxyZWFkeURlZmluZWRGb3JQcm9qZWN0aW9uLmpzIiwic291cmNlUm9vdCI6Ii4uLyIsInNvdXJjZXMiOlsiQnVpbGRlcnMvUmVhZE1vZGVsQWxyZWFkeURlZmluZWRGb3JQcm9qZWN0aW9uLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiI7QUFBQSwrQ0FBK0M7QUFDL0MscUdBQXFHOzs7QUFFckcsbURBQWdEO0FBS2hEOztHQUVHO0FBQ0gsTUFBYSxvQ0FBcUMsU0FBUSxxQkFBUztJQUMvRDs7Ozs7T0FLRztJQUNILFlBQVksWUFBMEIsRUFBRSxZQUFvQyxFQUFFLFlBQW9DO1FBQzlHLEtBQUssQ0FBQyxpQkFBaUIsWUFBWSxrQkFBa0IsWUFBWSxtQ0FBbUMsWUFBWSxFQUFFLENBQUMsQ0FBQztJQUN4SCxDQUFDO0NBQ0o7QUFWRCxvRkFVQyJ9