@dolittle/sdk.protobuf
Version:
Dolittle is a decentralized, distributed, event-driven microservice platform built to harness the power of events.
32 lines • 1.83 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.Failure = void 0;
const FailureId_1 = require("./FailureId");
const FailureReason_1 = require("./FailureReason");
/**
* Represents a unique failure that occurred when performing operations with the runtime.
*/
class Failure {
/**
* Initializes an instance of failure.
* @param {Failure} id - Unique identifier of the failure.
* @param {FailureReason} reason - Reason for failing.
*/
constructor(id, reason) {
this.id = id;
this.reason = reason;
}
/**
* Creates a {@link Failure} from a guid and a string.
* @param {Guid | string} id - Unique identifier of the failure.
* @param {string} reason - Reason for failing.
* @returns {Failure} The created failure.
*/
static from(id, reason) {
return new Failure(FailureId_1.FailureId.from(id), FailureReason_1.FailureReason.from(reason));
}
}
exports.Failure = Failure;
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiRmFpbHVyZS5qcyIsInNvdXJjZVJvb3QiOiIuLi8iLCJzb3VyY2VzIjpbIkZhaWx1cmUudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IjtBQUFBLCtDQUErQztBQUMvQyxxR0FBcUc7OztBQUlyRywyQ0FBd0M7QUFDeEMsbURBQWdEO0FBRWhEOztHQUVHO0FBQ0gsTUFBYSxPQUFPO0lBQ2hCOzs7O09BSUc7SUFDSCxZQUFxQixFQUFhLEVBQVcsTUFBcUI7UUFBN0MsT0FBRSxHQUFGLEVBQUUsQ0FBVztRQUFXLFdBQU0sR0FBTixNQUFNLENBQWU7SUFDbEUsQ0FBQztJQUVEOzs7OztPQUtHO0lBQ0gsTUFBTSxDQUFDLElBQUksQ0FBQyxFQUFpQixFQUFFLE1BQWM7UUFDekMsT0FBTyxJQUFJLE9BQU8sQ0FBQyxxQkFBUyxDQUFDLElBQUksQ0FBQyxFQUFFLENBQUMsRUFBRSw2QkFBYSxDQUFDLElBQUksQ0FBQyxNQUFNLENBQUMsQ0FBQyxDQUFDO0lBQ3ZFLENBQUM7Q0FDSjtBQWxCRCwwQkFrQkMifQ==