2 ms·
I do this and think it works really well... myfunc(arg: string): Value | Err I really try not to throw anymore with typescript, I do error checking like in Go
by candiddevmike 1y ago
I do this and think it works really well...
myfunc(arg: string): Value | Err
I really try not to throw anymore with typescript, I do error checking like in Go. When used with a Go backend, it makes context switching really easy...
- andy_ppp 1y agoThey still throw and just have millions of try catch blocks repeated everywhere around almost every function :-/
- chamomeal 1y agoI do actually love returning errors in TS. It solved most of the problems I have with error handling.
- andy_ppp 1y agoYes not terrible, I think throwing is often worse. I do think that Golang forcing you to deal with Errors immediately is just a bit extreme, sometimes it’s nice to have a choice or create abstractions about how to handle them.