You are viewing a plain text version of this content. The canonical link for it is here.
Posted to github@arrow.apache.org by GitBox <gi...@apache.org> on 2022/04/22 17:13:34 UTC

[GitHub] [arrow] zeroshade commented on a diff in pull request #12960: ARROW-16823: [Go] Cleanup panics in new Buffered Reader

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


##########
go/internal/utils/buf_reader.go:
##########
@@ -71,16 +78,17 @@ func (b *bufferedReader) fill() {
 	}
 
 	if b.w >= len(b.buf) {
-		panic("parquet/bufio: tried to fill full buffer")
+		return fmt.Errorf("arrow/bufferedreader: %w", bufio.ErrBufferFull)

Review Comment:
   they are different functionality. `errors.New` creates a new error from a single string. I'm using `fmt.Errorf` when I'm wrapping an error so that callers can still use `errors.Is(err, bufio.ErrBufferFull)` or otherwise to handle the errors



-- 
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