You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@arrow.apache.org by "lidavidm (via GitHub)" <gi...@apache.org> on 2025/07/10 01:41:00 UTC

[I] go: add Unwrap to adbc.Error [arrow-adbc]

lidavidm opened a new issue, #3126:
URL: https://github.com/apache/arrow-adbc/issues/3126

   ### What feature or improvement would you like to see?
   
   This would let us wrap "native" errors and provide chains of ADBC errors which may be useful in some cases.
   
   FFI/C would not be able to represent this quite right but maybe we can consider a similar unwrap method for the C definition (which would only unwrap to an ADBC error and not an arbitrary error)


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@arrow.apache.org.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [I] go: add Unwrap to adbc.Error [arrow-adbc]

Posted by "lidavidm (via GitHub)" <gi...@apache.org>.
lidavidm closed issue #3126: go: add Unwrap to adbc.Error
URL: https://github.com/apache/arrow-adbc/issues/3126


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@arrow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [I] go: add Unwrap to adbc.Error [arrow-adbc]

Posted by "zeroshade (via GitHub)" <gi...@apache.org>.
zeroshade commented on issue #3126:
URL: https://github.com/apache/arrow-adbc/issues/3126#issuecomment-3055200474

   Because `errors.Join` is relatively new (introduced with go1.20 I think?) before then you had to implement Unwrap and use `errors.Unwrap` which was introduced in go1.13.
   
   See the example [here](https://pkg.go.dev/errors#example-Join). Using `errors.Join` is sufficient for `errors.As` and `errors.Is` to detect and produce `adbc.Error` correctly


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: github-unsubscribe@arrow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [I] go: add Unwrap to adbc.Error [arrow-adbc]

Posted by "lidavidm (via GitHub)" <gi...@apache.org>.
lidavidm closed issue #3126: go: add Unwrap to adbc.Error
URL: https://github.com/apache/arrow-adbc/issues/3126


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@arrow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [I] go: add Unwrap to adbc.Error [arrow-adbc]

Posted by "lidavidm (via GitHub)" <gi...@apache.org>.
lidavidm commented on issue #3126:
URL: https://github.com/apache/arrow-adbc/issues/3126#issuecomment-3055188752

   Why do libraries implement Unwrap themselves then?


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: github-unsubscribe@arrow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [I] go: add Unwrap to adbc.Error [arrow-adbc]

Posted by "lidavidm (via GitHub)" <gi...@apache.org>.
lidavidm commented on issue #3126:
URL: https://github.com/apache/arrow-adbc/issues/3126#issuecomment-3054910819

   @zeroshade not sure if you have any thoughts. I find myself writing this a lot:
   
   ```
   defer func() {
   	err = errors.Join(err, something.Close())
   }()
   ```
   
   I think it would be nice to provide an `adbcerr.Join` that would preserve the ADBC-ness of the error. We can sorta do it today but there's no way to chain errors in a go-native way.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: github-unsubscribe@arrow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [I] go: add Unwrap to adbc.Error [arrow-adbc]

Posted by "zeroshade (via GitHub)" <gi...@apache.org>.
zeroshade commented on issue #3126:
URL: https://github.com/apache/arrow-adbc/issues/3126#issuecomment-3055006089

   `errors.Join` would retain the ADBC-ness of the error if either are an ADBC error 


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: github-unsubscribe@arrow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [I] go: add Unwrap to adbc.Error [arrow-adbc]

Posted by "zeroshade (via GitHub)" <gi...@apache.org>.
zeroshade commented on issue #3126:
URL: https://github.com/apache/arrow-adbc/issues/3126#issuecomment-3055206072

   The only reason to implement Unwrap nowadays is if you want an error type to be able to unwrap as a different error type than it is.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: github-unsubscribe@arrow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [I] go: add Unwrap to adbc.Error [arrow-adbc]

Posted by "lidavidm (via GitHub)" <gi...@apache.org>.
lidavidm commented on issue #3126:
URL: https://github.com/apache/arrow-adbc/issues/3126#issuecomment-3055577773

   Ah, good to know. (Probably shouldn't look too closely at this weird library that seems to be all old Go code then...)


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: github-unsubscribe@arrow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org