9 ms·
The thing is... the "try" proposal doesn't stop people from using the existing error handling. To me, 'try' is there to simplify the simple cases where you don
by kyrra 7y ago
The thing is... the "try" proposal doesn't stop people from using the existing error handling. To me, 'try' is there to simplify the simple cases where you don't need to do anything special except return the 'err' from a function call.
There are many ways error handling could be changed that would make the system more complex (such as the "expect" or "catch" proposals he links to). 'try' is to handle the super simple, repetitive case.
One more downside I could see is that people will just start using 'try' without thinking about how they should really handle an error, but I feel like that already happens today, so 'try' should just simplify code.