Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix logic bug in error handling #130

Merged
merged 1 commit into from Oct 16, 2019

Conversation

@mjlangan
Copy link
Member

mjlangan commented Oct 15, 2019

I copied this pattern from the code I added in the Leaderboard, and we discovered today that there's a bug in the error handling logic. If EnsureDefualtWorkspace is called when the workspace doesn't exist, we'd work our way to the CreateWorkspace call, and that call succeeds, but then the function would return at line 58 with values "", nil

This change modifies the logic to make sure that we only return in these cases:

  1. A non-API error, or an API error that isn't a not found
  2. Failure to create the workspace
  3. The workspace now exists (either by the initial lookup or a successful create) and we return the reference and no error.
@mjlangan mjlangan requested review from ckarenz and allenai/beaker Oct 15, 2019
@mjlangan mjlangan merged commit 0773287 into master Oct 16, 2019
1 check passed
1 check passed
ci/circleci: build Your tests passed on CircleCI!
Details
@mjlangan mjlangan deleted the mjlangan/fix-logic-bug branch Oct 16, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
2 participants
You can’t perform that action at this time.