@@ -16,14 +16,14 @@ package cohere
16
16
17
17
import (
18
18
"context"
19
- "errors"
20
19
"fmt"
21
20
"time"
22
21
23
22
cohere "github.com/cohere-ai/cohere-go/v2"
24
23
cohereClient "github.com/cohere-ai/cohere-go/v2/client"
25
24
"github.com/conduitio/conduit-commons/opencdc"
26
25
sdk "github.com/conduitio/conduit-processor-sdk"
26
+ "github.com/conduitio/conduit/pkg/foundation/cerrors"
27
27
)
28
28
29
29
func (p * Processor ) processCommandModel (ctx context.Context , records []opencdc.Record ) []sdk.ProcessedRecord {
@@ -51,9 +51,9 @@ func (p *Processor) processCommandModel(ctx context.Context, records []opencdc.R
51
51
52
52
if err != nil {
53
53
switch {
54
- case errors .As (err , & cohere.GatewayTimeoutError {}),
55
- errors .As (err , & cohere.InternalServerError {}),
56
- errors .As (err , & cohere.ServiceUnavailableError {}):
54
+ case cerrors .As (err , & cohere.GatewayTimeoutError {}),
55
+ cerrors .As (err , & cohere.InternalServerError {}),
56
+ cerrors .As (err , & cohere.ServiceUnavailableError {}):
57
57
58
58
if attempt < p .config .BackoffRetryCount {
59
59
sdk .Logger (ctx ).Debug ().Err (err ).Float64 ("attempt" , attempt ).
@@ -86,7 +86,6 @@ func (p *Processor) processCommandModel(ctx context.Context, records []opencdc.R
86
86
}
87
87
out = append (out , sdk .SingleRecord (record ))
88
88
break
89
-
90
89
}
91
90
}
92
91
return out
0 commit comments