Re:You Can Throw() Anything in JavaScript – and Other Async/...
by sirsuki on Friday April 08, 2022 @07:22AM
(#30955618)
If you need to use a rejection as a meaningful thing other than an actual exception then it really isn’t an exception is it? Instead fulfill the promise with an object that actually represents the state. Perhaps with a status property. Otherwise your code is going to look like a hot mess and you’ll just confuse generations of developers. Just because you can does not mean you should.
[ Parent
| on HN ]
There are no comments on this comment yet.