Re: [go-nuts] Finding error type for `errors.As` and `errors.Is`

2021-04-05 Thread Jonathan Amsterdam
You can write such a function yourself. For that reason and since it would be rarely useful, I don't think it's likely to become part of the standard library. On Thursday, April 1, 2021 at 9:02:34 AM UTC-4 Michael Schaller wrote: > Roger, I think you slightly misunderstood me. ;-) > > It is

Re: [go-nuts] Finding error type for `errors.As` and `errors.Is`

2021-04-01 Thread 'Michael Schaller' via golang-nuts
Roger, I think you slightly misunderstood me. ;-) It is true that `As` and `Is` methods can be used to allow `errors.As` and `errors.Is` to handle error types that aren't actually in the error chain. However my question was if an `errors.Chain` function which returns details about the error

Re: [go-nuts] Finding error type for `errors.As` and `errors.Is`

2021-03-31 Thread roger peppe
On Wed, 31 Mar 2021 at 18:05, 'Michael Schaller' via golang-nuts < golang-nuts@googlegroups.com> wrote: > Hi everyone, > > I often encounter deep error chains where errors are wrapped across > several Go packages and that makes it often hard to find a usable error > type to use with `errors.As`