You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I've been looking at the Error module. It is hard to raise exceptions because each of the different types are exposed in sub-modules like Error.SyntaxError that contain a single function - raise. At a glance you can't tell what the different types of exceptions are and must navigate into the sub-module to do it. The Intellisense menu looks like this...
I much prefer the Js.Exn way of doing it.
I notice an Error.make function. Is there anything you can do with it before raising it? Because if not, just remove make and go straight to throwing. If we want the ability to add custom properties first, I'm not sure how you'd do that. Consider adding some of the get and set functions from Object or convert to object.
The text was updated successfully, but these errors were encountered:
I've been looking at the Error module. It is hard to raise exceptions because each of the different types are exposed in sub-modules like
Error.SyntaxError
that contain a single function -raise
. At a glance you can't tell what the different types of exceptions are and must navigate into the sub-module to do it. The Intellisense menu looks like this...I much prefer the
Js.Exn
way of doing it.I notice an
Error.make
function. Is there anything you can do with it before raising it? Because if not, just removemake
and go straight to throwing. If we want the ability to add custom properties first, I'm not sure how you'd do that. Consider adding some of theget
andset
functions fromObject
or convert to object.The text was updated successfully, but these errors were encountered: