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

Commit

Permalink
Merge pull request #588 from gregbty/master
Browse files Browse the repository at this point in the history
Destructure the correct error object
  • Loading branch information
hwillson authored Aug 12, 2020
2 parents 191925d + 9088ed8 commit e193535
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@
[@benjie](https://github.com/benjie) in [#514](https://github.com/apollographql/subscriptions-transport-ws/pull/514)
- Fix invalid `formatResponse` console error. <br/>
[@renatorib](https://github.com/renatorib) in [#761](https://github.com/apollographql/subscriptions-transport-ws/pull/761)
- Destructure the correct error object in `MessageTypes.GQL_START`. <br/>
[@gregbty](https://github.com/gregbty) in [#588](https://github.com/apollographql/subscriptions-transport-ws/pull/588)

### New Features

Expand Down
4 changes: 2 additions & 2 deletions src/server.ts
Original file line number Diff line number Diff line change
Expand Up @@ -400,8 +400,8 @@ export class SubscriptionServer {
}

// plain Error object cannot be JSON stringified.
if (Object.keys(e).length === 0) {
error = { name: e.name, message: e.message };
if (Object.keys(error).length === 0) {
error = { name: error.name, message: error.message };
}

this.sendError(connectionContext, opId, error);
Expand Down

0 comments on commit e193535

Please sign in to comment.