I think both of the proposals are fine, but they suffer from the “lack of completeness”. In that, they improve things, but don’t go far enough so the incremental benefit is not high enough. A key component of exceptions is the concept of ‘throws’ which is both self documenting, and requires handling, which enables flow analysis (manual and automated). These proposals don’t supply this functionality. They also don’t cover automatic stack capture, which is essential in diagnosing problems in large, complex systems.
> On Jun 30, 2019, at 11:04 AM, Liam <networkimp...@gmail.com> wrote: > > If you really care to "catch" errors, you want this: > https://github.com/golang/go/issues/27519 > > If all you need is to allocate a line to check an error and take an action, > you want this: > https://github.com/golang/go/issues/32611 > > But it's all moot. the Go team has told us we must prove that try is > inadequate for existing Go projects, and altho that can be proved, it won't > be clear for a couple years until use of Error Values propagates. > >> On Thursday, June 27, 2019 at 11:44:23 AM UTC-7, Nate Finch wrote: >> I really don't like the try proposal, because I think it hurts readabiity of >> the code. But I think the fix is not too hard, so I made a counter >> proposal, catch: >> >> https://github.com/golang/go/issues/32811 >> >> Catch works just like try, except it has to be a statement and has to be >> passed an error explicitly, rather than returning arguments to the left hand >> side. This make the conversion of old code to new code look a lot more like >> normal go code. >> >> > > -- > You received this message because you are subscribed to the Google Groups > "golang-nuts" group. > To unsubscribe from this group and stop receiving emails from it, send an > email to golang-nuts+unsubscr...@googlegroups.com. > To view this discussion on the web visit > https://groups.google.com/d/msgid/golang-nuts/68e3407a-57cc-42f2-8819-7c0369f5ca4b%40googlegroups.com. > For more options, visit https://groups.google.com/d/optout. -- You received this message because you are subscribed to the Google Groups "golang-nuts" group. To unsubscribe from this group and stop receiving emails from it, send an email to golang-nuts+unsubscr...@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/golang-nuts/5A743793-FDAB-494F-B297-6486AE30839D%40ix.netcom.com. For more options, visit https://groups.google.com/d/optout.