debug for errors that are killing the pipeline
This commit is contained in:
parent
f1af849e81
commit
0dce2a6045
1 changed files with 8 additions and 1 deletions
|
|
@ -3,6 +3,7 @@ package connector
|
||||||
import (
|
import (
|
||||||
"log"
|
"log"
|
||||||
"math"
|
"math"
|
||||||
|
"reflect"
|
||||||
"time"
|
"time"
|
||||||
|
|
||||||
"github.com/ezoic/go-kinesis"
|
"github.com/ezoic/go-kinesis"
|
||||||
|
|
@ -23,12 +24,18 @@ type Pipeline struct {
|
||||||
Transformer Transformer
|
Transformer Transformer
|
||||||
}
|
}
|
||||||
|
|
||||||
|
var pipelineRecoverableErrorCodes = map[string]bool{
|
||||||
|
"ProvisionedThroughputExceededException": true,
|
||||||
|
}
|
||||||
|
|
||||||
// this determines whether the error is recoverable
|
// this determines whether the error is recoverable
|
||||||
func (p Pipeline) isRecoverableError(err error) bool {
|
func (p Pipeline) isRecoverableError(err error) bool {
|
||||||
r := false
|
r := false
|
||||||
|
|
||||||
|
l4g.Debug("isRecoverableError, type %s, value (+%v)", reflect.TypeOf(err).Name(), err)
|
||||||
|
|
||||||
cErr, ok := err.(*kinesis.Error)
|
cErr, ok := err.(*kinesis.Error)
|
||||||
if ok && cErr.Code == "ProvisionedThroughputExceededException" {
|
if ok && pipelineRecoverableErrorCodes[cErr.Code] == true {
|
||||||
r = true
|
r = true
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue