Throw if endpoind is not provided
This commit is contained in:
@ -105,6 +105,9 @@ export class Connection {
|
|||||||
_rpcRequest: RpcRequest;
|
_rpcRequest: RpcRequest;
|
||||||
|
|
||||||
constructor(endpoint: string) {
|
constructor(endpoint: string) {
|
||||||
|
if (typeof endpoint !== 'string') {
|
||||||
|
throw new Error('Connection endpoint not specified');
|
||||||
|
}
|
||||||
this._rpcRequest = createRpcRequest(endpoint);
|
this._rpcRequest = createRpcRequest(endpoint);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user