UNPKG

@dolittle/sdk.projections

Version:

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

28 lines 2.07 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.FailedToGetProjection = void 0; const rudiments_1 = require("@dolittle/rudiments"); /** * Exception that gets thrown when getting a projection fails. */ class FailedToGetProjection extends rudiments_1.Exception { /** * Initialises a new instance of the {@link FailedToGetProjection} class. * @param {ProjectionId} projection - The id of the projection to get. * @param {ScopeId} scope - The scope of the projection to get. * @param {Key | undefined} key - The optional key of the projection to get. * @param {Failure} failure - The failure that occured. */ constructor(projection, scope, key, failure) { if (key) { super(`Failed to get projection ${projection} in scope ${scope} with key ${key} due to failure ${failure.id} with reason: ${failure.reason}`); } else { super(`Failed to get projection ${projection} in scope ${scope} due to failure ${failure.id} with reason: ${failure.reason}`); } } } exports.FailedToGetProjection = FailedToGetProjection; //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiRmFpbGVkVG9HZXRQcm9qZWN0aW9uLmpzIiwic291cmNlUm9vdCI6Ii4uLyIsInNvdXJjZXMiOlsiU3RvcmUvRmFpbGVkVG9HZXRQcm9qZWN0aW9uLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiI7QUFBQSwrQ0FBK0M7QUFDL0MscUdBQXFHOzs7QUFFckcsbURBQWdEO0FBUWhEOztHQUVHO0FBQ0gsTUFBYSxxQkFBc0IsU0FBUSxxQkFBUztJQUNoRDs7Ozs7O09BTUc7SUFDSCxZQUFZLFVBQXdCLEVBQUUsS0FBYyxFQUFFLEdBQW9CLEVBQUUsT0FBZ0I7UUFDeEYsSUFBSSxHQUFHLEVBQUU7WUFDTCxLQUFLLENBQUMsNEJBQTRCLFVBQVUsYUFBYSxLQUFLLGFBQWEsR0FBRyxtQkFBbUIsT0FBTyxDQUFDLEVBQUUsaUJBQWlCLE9BQU8sQ0FBQyxNQUFNLEVBQUUsQ0FBQyxDQUFDO1NBQ2pKO2FBQU07WUFDSCxLQUFLLENBQUMsNEJBQTRCLFVBQVUsYUFBYSxLQUFLLG1CQUFtQixPQUFPLENBQUMsRUFBRSxpQkFBaUIsT0FBTyxDQUFDLE1BQU0sRUFBRSxDQUFDLENBQUM7U0FDakk7SUFDTCxDQUFDO0NBQ0o7QUFmRCxzREFlQyJ9