Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 9 additions & 6 deletions token.go
Original file line number Diff line number Diff line change
Expand Up @@ -1194,16 +1194,19 @@ func (t tokenProcessor) nextToken() (tokenStruct, error) {
// prioritize it over cancellation channel
select {
case tok, more := <-t.tokChan:
err, more := tok.(error)
if more {
t.sess.LogF(t.ctx, msdsn.LogDebug, "nextToken returned an error:"+err.Error())
// this is an error and not a token
return nil, err
err, ok := tok.(error)
if ok {
t.sess.LogF(t.ctx, msdsn.LogDebug, "nextToken returned an error:"+err.Error())
// this is an error and not a token
return nil, err
} else {
return tok, nil
}
} else {
return tok, nil
return nil, nil
}
default:
// there are no tokens on the channel, will need to wait
}

select {
Expand Down