zeroshade commented on code in PR #14146:
URL: https://github.com/apache/arrow/pull/14146#discussion_r978844604


##########
go/arrow/array/concat.go:
##########
@@ -42,7 +43,12 @@ func Concatenate(arrs []arrow.Array, mem memory.Allocator) 
(result arrow.Array,
 
        defer func() {
                if pErr := recover(); pErr != nil {
-                       err = fmt.Errorf("arrow/concat: unknown error: %v", 
pErr)
+                       switch e := pErr.(type) {
+                       case error:

Review Comment:
   using `%w` wraps the error that was panic'd so that someone receiving the 
error can use `errors.Is` or `errors.As` if they desire to react differently 
based on the type of the error (such as `arrow.ErrInvalid` vs `arrow.ErrIndex` 
vs `arrow.ErrNotImplemented` etc...) basically it creates an error chain
   
   In the case of the `"unknown error"` it means that we had a panic with a 
string rather than a proper error instance. Though I agree that the text 
"unknown error" doesn't contribute much to a user's understanding here, so i'll 
just get rid of that.



-- 
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: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to