Skip to content

[exercises/concept/fruit-picker] Exercise requires users to be familiar with the throw statement #1634

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

Closed
Tracked by #1415
nacaru-w opened this issue Jan 22, 2022 · 7 comments · Fixed by #1725
Closed
Tracked by #1415
Labels
x:action/fix Fix an issue x:knowledge/intermediate Quite a bit of Exercism knowledge required x:module/concept-exercise Work on Concept Exercises x:rep/medium Medium amount of reputation x:status/claimed Someone is working on this issue x:type/content Work on content (e.g. exercises, concepts)

Comments

@nacaru-w
Copy link
Contributor

While I was doing the exercise myself (which is made to test users about the Arrow functions and Callbacks concepts), I came across something that I found a bit confusing: task 3 of this exercise requires users to

[...] throw a new error if err is not null.

This implies using the javascript throw statement as part of the function the exercise asks you to build. However, the Errors concept (where the throwstatement is developed) is to be found much further down the syllabus tree, and the way the instruction is described in the task might make users think that "throwing an error" just means returning a string with an message with an error text as opposed to using the error statement. This is what I did myself, which meant that when running the tests, I got a message from the debugger saying that I was supposed to use something I didn't even know existed to complete the exercise.

I believe this can be easily fixed by either:

  • Making sure the instruction of the task is clear about what the user needs to use (the errorstatement). An easy fix to this would be to add a link to its MDN page in the very same paragraph.
  • Removing the need to use such statement. This would imply modifying the exercise so that users are required to simply return a string with an error message instead.
@SleeplessByte SleeplessByte added the bug 🐛 Something isn't working label Jan 23, 2022
@SleeplessByte
Copy link
Member

Thanks for bringing this up.

It seems indeed that the prerequisite is missing. We'll have a talk about what's wise here.

@junedev
Copy link
Member

junedev commented Jan 23, 2022

Yes, great catch indeed. I will take a closer look what's the best way forward here.

@pikkus

This comment was marked as off-topic.

@junedev

This comment was marked as off-topic.

@sergioreynoso
Copy link

Hello, in Task 3 it says "Finish the purchaseInventoryIfAvailable callback function to be used with the grocer's checkInventory API function.", but the checkInventory callback takes a query and a callback. I'm confused as to how I'm to use checkInventory in this exercise.

@obrunopereira
Copy link

Hello, in Task 3 it says "Finish the purchaseInventoryIfAvailable callback function to be used with the grocer's checkInventory API function.", but the checkInventory callback takes a query and a callback. I'm confused as to how I'm to use checkInventory in this exercise.

I'm stuck at the same point. Came here for help.

@ievgenk
Copy link

ievgenk commented Mar 28, 2022

Heya @sergioreynoso @obrunopereira ,
I believe what they mean by saying that, is that "purchaseInventoryIfAvailable" is going to be that callback that goes into "checkInventory"

You do not need to use "checkInventroy" in the 3rd task.

@junedev junedev linked a pull request Apr 19, 2022 that will close this issue
@junedev junedev added x:status/claimed Someone is working on this issue x:action/fix Fix an issue x:knowledge/intermediate Quite a bit of Exercism knowledge required x:module/concept-exercise Work on Concept Exercises x:type/content Work on content (e.g. exercises, concepts) x:rep/medium Medium amount of reputation and removed bug 🐛 Something isn't working labels Apr 29, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
x:action/fix Fix an issue x:knowledge/intermediate Quite a bit of Exercism knowledge required x:module/concept-exercise Work on Concept Exercises x:rep/medium Medium amount of reputation x:status/claimed Someone is working on this issue x:type/content Work on content (e.g. exercises, concepts)
Projects
None yet
Development

Successfully merging a pull request may close this issue.

7 participants