Skip to content

Commit

Permalink
Throw when stop() is called improperly after load failure
Browse files Browse the repository at this point in the history
  • Loading branch information
trevor-scheer committed Mar 10, 2021
1 parent 9706663 commit 4c341a7
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions gateway-js/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -997,10 +997,10 @@ export class ApolloGateway implements GraphQLService {
public async stop() {
switch (this.state.phase) {
case 'initialized':
case 'failed to load':
throw Error(
'ApolloGateway.stop does not need to be called before ApolloGateway.load',
'ApolloGateway.stop does not need to be called before ApolloGateway.load is called successfully',
);
case 'failed to load':
case 'stopped':
// Calls to stop() are idempotent.
return;
Expand Down

0 comments on commit 4c341a7

Please sign in to comment.