-
-
Notifications
You must be signed in to change notification settings - Fork 362
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
Return error message for unknown track status #301
Return error message for unknown track status #301
Conversation
if _, err := c.List(trackID); err != nil { | ||
return nil, err | ||
} | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do we not need to do anything with the result of the List?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No, we just need to return an error here if the Track doesn't exist.
I looked into the API a bit and it looks like the /tracks/<trackID>/status
endpoint returns the same response for both valid and invalid tracks, so we just need to first check that the track exists and return an error if it doesn't instead of parsing the response.
If there's no error here, then Status
looks at the fetched problems and recent problems, so we don't need the List
results.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
/tracks/:track_id/status is the endpoint for a problem named "status" which we don't have.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sorry, I should have been more specific.
This is the endpoint I was referencing:
http://exercism.io/api/v1/tracks/elixir/status?key=<someKey>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
OK, I think that the fix is to improve that endpoint so that it says whether or not the track exists. Are you comfortable in Ruby? If not, no worries, I can do this easily.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'll fork that repo right now 👍
The fix to the command looks good, I just have the one question about the change in the API. |
Hey @kytrinyx, I submitted exercism/exercism#2806 to address this. I can remove the changes I made in the |
6c87ab1
to
1ead254
Compare
Oh, cool! Yeah, this is better. |
Merging this since exercism/exercism#2806 has been merged |
Thanks @Tonkpils! I hope I can help out again! |
Fixes #298
This is my first attempt at a contribution here, so I hope I didn't miss anything too obvious.. 😄