javascript icon indicating copy to clipboard operation
javascript copied to clipboard

add error-handling exercise

Open A-O-Emmanuel opened this issue 7 months ago • 13 comments

Implemented the Error Handling practice exercise with solution, tests, and documentation

A-O-Emmanuel avatar Jul 24 '25 23:07 A-O-Emmanuel

Hello. Thanks for opening a PR on Exercism 🙂

We ask that all changes to Exercism are discussed on our Community Forum before being opened on GitHub. To enforce this, we automatically close all PRs that are submitted. That doesn't mean your PR is rejected but that we want the initial discussion about it to happen on our forum where a wide range of key contributors across the Exercism ecosystem can weigh in.

You can use this link to copy this into a new topic on the forum. If we decide the PR is appropriate, we'll reopen it and continue with it, so please don't delete your local branch.

If you're interested in learning more about this auto-responder, please read this blog post.


Note: If this PR has been pre-approved, please link back to this PR on the forum thread and a maintainer or staff member will reopen it.

github-actions[bot] avatar Jul 24 '25 23:07 github-actions[bot]

/format

SleeplessByte avatar Jul 25 '25 00:07 SleeplessByte

The "Format code" action has started running.

github-actions[bot] avatar Jul 25 '25 00:07 github-actions[bot]

The "Format code" action has finished running.

github-actions[bot] avatar Jul 25 '25 00:07 github-actions[bot]

For security reasons, /format does not trigger CI builds when the PR has been submitted from a fork. If checks were not passing due to code format, trigger a build to make the required checks pass, through one of the following ways:

  • Push an empty commit to this branch: git commit --allow-empty -m "Trigger builds".
  • Close and reopen the PR.
  • Push a regular commit to this branch.

github-actions[bot] avatar Jul 25 '25 00:07 github-actions[bot]

Hi @SleeplessByte thanks for your review, sorry it took this long for me to reply, just to clarify, when you say "The only issue I have is that this isn't actually handling any error!" do you mean that the function should include descriptive error messages rather than handling more complex error scenarios?

A-O-Emmanuel avatar Aug 26 '25 20:08 A-O-Emmanuel

@A-O-Emmanuel no worries! We are not in a hurry.

Right now, the exercise wants you to throw errors. It doesn't want you to handle the error.

Handling errors could be:

try { } catch { }

or

promise.catch(...)

or

try { } finally { }

or

promise.finally(...)

SleeplessByte avatar Aug 28 '25 14:08 SleeplessByte

Oh, that's true, I'll just have to revert back to the way I did it before. Thanks for the clarification, I've learnt something today, "throwing errors and handling errors" are two different things, yeah, it makes sense, thank you.

A-O-Emmanuel avatar Aug 28 '25 15:08 A-O-Emmanuel

@Cool-Katt how do you feel about this?

SleeplessByte avatar Oct 16 '25 18:10 SleeplessByte

I was kinda out of the loop on this one so I can review in more depth tomorrow, but preliminary assessment is that I would have liked to see a couple of more tests.

I'll probably have to get up to speed first tho, to comment more

Cool-Katt avatar Oct 16 '25 20:10 Cool-Katt

Hi @Cool-Katt, okay I will add more tests, but I'll wait for your final assessment before adding more tests.

A-O-Emmanuel avatar Oct 27 '25 14:10 A-O-Emmanuel

Right, sorry folks, real life got in the way. Anyway.

The way I see it, currently its a good effort but i'd maybe like to see some more restrictions/explicit handling scenarios. It also definitely needs more tests and maybe a rewrite of the instructions.

Cool-Katt avatar Oct 29 '25 12:10 Cool-Katt

Okay @Cool-Katt, thanks, just got the chance to look at your comments, been really occupied, but I should be free ending of next week to start implementing your suggestions, thank you.

A-O-Emmanuel avatar Nov 09 '25 18:11 A-O-Emmanuel

hi @Cool-Katt I've made changes and added more tests, please review, and sorry for the delay.

A-O-Emmanuel avatar Dec 28 '25 00:12 A-O-Emmanuel