@dolittle/sdk.services
Version:
Dolittle is a decentralized, distributed, event-driven microservice platform built to harness the power of events.
26 lines (21 loc) • 992 B
text/typescript
// Copyright (c) Dolittle. All rights reserved.
// Licensed under the MIT license. See LICENSE file in the project root for full license information.
import { Exception } from '@dolittle/rudiments';
/**
* Exception that gets thrown when the a the connection to the Runtime could not be established.
*/
export class CouldNotConnectToRuntime extends Exception {
/**
* Initializes a new instance of {@link CouldNotConnectToRuntime}.
* @param {string} address - The address of the Runtime that was connected to.
*/
constructor(address: string) {
super(`Could not connect to a Runtime on '${CouldNotConnectToRuntime.getStrippedAddress(address)}'. Please make sure a Runtime is running, and that the private port (usually 50053) is accessible on the specified port.`);
}
private static getStrippedAddress(address: string): string {
if (address.startsWith('dns:')) {
return address.slice(4);
}
return address;
}
}