Skip to content
This repository has been archived by the owner on Apr 14, 2023. It is now read-only.

Commit

Permalink
Don't handle promisedParams error twice
Browse files Browse the repository at this point in the history
  • Loading branch information
benjie authored Feb 28, 2019
1 parent 34d503a commit b2144c6
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions src/server.ts
Original file line number Diff line number Diff line change
Expand Up @@ -329,7 +329,7 @@ export class SubscriptionServer {
promisedParams = Promise.resolve(this.onOperation(messageForCallback, baseParams, connectionContext.socket));
}

promisedParams.then((params) => {
return promisedParams.then((params) => {
if (typeof params !== 'object') {
const error = `Invalid params returned from onOperation! return values must be an object!`;
this.sendError(connectionContext, opId, { message: error });
Expand Down Expand Up @@ -425,7 +425,6 @@ export class SubscriptionServer {
this.unsubscribe(connectionContext, opId);
return;
});
return promisedParams;
}).catch((error) => {
// Handle initPromise rejected
this.sendError(connectionContext, opId, { message: error.message });
Expand Down

0 comments on commit b2144c6

Please sign in to comment.