ing
This commit is contained in:
parent
769594fb9f
commit
aad7abe211
|
@ -130,15 +130,15 @@ export abstract class RPCClient<T> {
|
||||||
this._pendingRequests.delete(id);
|
this._pendingRequests.delete(id);
|
||||||
this._pendingRequestsCount--;
|
this._pendingRequestsCount--;
|
||||||
|
|
||||||
if (undefined !== result) {
|
if (undefined !== error) {
|
||||||
reqState.subject.next(result);
|
|
||||||
} else if (undefined !== error) {
|
|
||||||
const rpcClientError: RPCClientError = {
|
const rpcClientError: RPCClientError = {
|
||||||
request: reqState.request,
|
request: reqState.request,
|
||||||
response: error,
|
response: error,
|
||||||
};
|
};
|
||||||
console.error(rpcClientError);
|
console.error(rpcClientError);
|
||||||
reqState.subject.error(rpcClientError);
|
reqState.subject.error(rpcClientError);
|
||||||
|
} else {
|
||||||
|
reqState.subject.next(result);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -94,11 +94,11 @@ export class JSONRPCClientResponseCodec implements RPCClientResponseCodec {
|
||||||
}
|
}
|
||||||
|
|
||||||
public isNotification(): boolean {
|
public isNotification(): boolean {
|
||||||
if (undefined !== this.id() || undefined === this.result()) {
|
if (undefined === this.id() && undefined !== this.result()) {
|
||||||
return false;
|
|
||||||
}
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
public notification(): RPCClientNotificationCodec | undefined {
|
public notification(): RPCClientNotificationCodec | undefined {
|
||||||
if (undefined !== this.id() || undefined === this.result()) {
|
if (undefined !== this.id() || undefined === this.result()) {
|
||||||
|
|
Loading…
Reference in New Issue
Block a user