Skip to content

Commit

Permalink
Use error equals (#2636)
Browse files Browse the repository at this point in the history
  • Loading branch information
juchaosong authored Apr 9, 2020
1 parent 8c29e05 commit 0a3b159
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions persist/sqldb/workflow_archive.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ package sqldb
import (
"context"
"encoding/json"
"strings"
"time"

log "github.com/sirupsen/logrus"
Expand Down Expand Up @@ -182,7 +181,7 @@ func (r *workflowArchive) GetWorkflow(uid string) (*wfv1.Workflow, error) {
And(db.Cond{"uid": uid}).
One(archivedWf)
if err != nil {
if strings.Contains(err.Error(), "no more rows") {
if err == db.ErrNoMoreRows {
return nil, nil
}
return nil, err
Expand Down

0 comments on commit 0a3b159

Please sign in to comment.