Hacker News new | past | comments | ask | show | jobs | submit login

The thing is not using try/catch, like the first case, sometimes you don't know if a function will throw or not. You can't tell from the function signature as well.

So this provides a way that told you the function you called might throw. It's more like an alert before a crash.

[res, err] is good, actually I used this style for a long time. `unwrapit` is a nicer way to let you write [res, err], like type hints and other utility methods.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: