Skip to content

Commit

Permalink
error processing
Browse files Browse the repository at this point in the history
  • Loading branch information
leo-cai-timeplus committed Jan 15, 2024
1 parent 0fdf24e commit f051662
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions conn_streaming_buffer.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ import (
"context"
"errors"
"fmt"
"log"
"strings"
"sync"
"time"
Expand Down Expand Up @@ -145,7 +144,7 @@ func (b *streamingBuffer) Send() (err error) {
b.once.Do(func() {
go func() {
if err = b.conn.process(b.ctx, b.onProcess); err != nil {
log.Fatal(err)
b.err = err
}
b.done <- struct{}{}
}()
Expand All @@ -157,6 +156,12 @@ func (b *streamingBuffer) Send() (err error) {
}

func (b *streamingBuffer) ReplaceBy(cols ...column.Interface) (err error) {
if b.sent {
return ErrStreamingBufferClosed
}
if b.err != nil {
return b.err
}
if len(b.block.Columns) != len(cols) {
return errors.New(fmt.Sprintf("colomn number is %d, not %d", len(b.block.Columns), len(cols)))
}
Expand Down

0 comments on commit f051662

Please sign in to comment.