Skip to content

Commit

Permalink
Don't swallow errors from Engine (#705)
Browse files Browse the repository at this point in the history
* Don't swallow errors from Engine

Throw errors we receive from Engine so we can provide the right feedback
to users and handle the errors.

* error.message is already a string, don't interpolate

Fixes #701
  • Loading branch information
trevor-scheer authored Nov 14, 2018
1 parent 8169dc1 commit 809c027
Showing 1 changed file with 12 additions and 12 deletions.
24 changes: 12 additions & 12 deletions packages/apollo-language-server/src/engine/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -130,9 +130,9 @@ export class ApolloEngineClient extends GraphQLDataSource {
);
}
// use error logger
// if (errors) {
// throw new Error(errors);
// }
if (errors) {
throw new Error(errors.map(error => error.message).join("\n"));
}
if (!data) {
throw new Error("Error in request from Engine");
}
Expand All @@ -151,9 +151,9 @@ export class ApolloEngineClient extends GraphQLDataSource {
);
}
// use error logger
// if (errors) {
// throw new Error(errors);
// }
if (errors) {
throw new Error(errors.map(error => error.message).join("\n"));
}
if (!data) {
throw new Error("Error in request from Engine");
}
Expand All @@ -170,9 +170,9 @@ export class ApolloEngineClient extends GraphQLDataSource {
);
}
// use error logger
// if (errors) {
// throw new Error(errors);
// }
if (errors) {
throw new Error(errors.map(error => error.message).join("\n"));
}
if (!data) {
throw new Error("Error in request from Engine");
}
Expand All @@ -190,9 +190,9 @@ export class ApolloEngineClient extends GraphQLDataSource {
);
}
// use error logger
// if (errors) {
// throw new Error(errors);
// }
if (errors) {
throw new Error(errors.map(error => error.message).join("\n"));
}
if (!data) {
throw new Error("Error in request from Engine");
}
Expand Down

0 comments on commit 809c027

Please sign in to comment.