DEV Community

Discussion on: Errors Are Not Exceptions

Collapse
devinrhode2 profile image
Devin Rhode

Created a wrapper function to do this:

const [thing, error] = safeCall(getThing)
Enter fullscreen mode Exit fullscreen mode

gist.github.com/devinrhode2/254255...