This commit is contained in:
crusader 2018-05-27 16:05:54 +09:00
parent 769594fb9f
commit aad7abe211
2 changed files with 6 additions and 6 deletions

View File

@ -130,15 +130,15 @@ export abstract class RPCClient<T> {
this._pendingRequests.delete(id);
this._pendingRequestsCount--;
if (undefined !== result) {
reqState.subject.next(result);
} else if (undefined !== error) {
if (undefined !== error) {
const rpcClientError: RPCClientError = {
request: reqState.request,
response: error,
};
console.error(rpcClientError);
reqState.subject.error(rpcClientError);
} else {
reqState.subject.next(result);
}
}

View File

@ -94,11 +94,11 @@ export class JSONRPCClientResponseCodec implements RPCClientResponseCodec {
}
public isNotification(): boolean {
if (undefined !== this.id() || undefined === this.result()) {
return false;
}
if (undefined === this.id() && undefined !== this.result()) {
return true;
}
return false;
}
public notification(): RPCClientNotificationCodec | undefined {
if (undefined !== this.id() || undefined === this.result()) {