r/learnjavascript • u/slvfox • Dec 19 '21
Help with Error Handling and Try/Catch
How do you fire a specific function based on the error received from a try block?
I am working through the javascript track on exercism and am having trouble with the third part of the Factory Sensors problem. Any help would be greatly appreciated.
5
Upvotes
View all comments
Show parent comment
4
u/slvfox Dec 19 '21
Thank you so much!
The issue is I don't understand why the if in the catch block isn't working. Am I somehow calling the instance of the error wrong?