Skip to content

Commit

Permalink
adding error check for new UUID
Browse files Browse the repository at this point in the history
Signed-off-by: Gaurav Gahlot <[email protected]>
  • Loading branch information
gauravgahlot committed Sep 9, 2020
1 parent ded5f52 commit 9ff1739
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions grpc-server/workflow.go
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,10 @@ func (s *server) CreateWorkflow(ctx context.Context, in *workflow.CreateRequest)
msg := ""
labels["op"] = "createworkflow"
msg = "creating a new workflow"
id, _ := uuid.NewUUID()
id, err := uuid.NewUUID()
if err != nil {
return &workflow.CreateResponse{}, err
}
fn := func() error {
wf := db.Workflow{
ID: id.String(),
Expand All @@ -57,7 +60,7 @@ func (s *server) CreateWorkflow(ctx context.Context, in *workflow.CreateRequest)
defer timer.ObserveDuration()

logger.Info(msg)
err := fn()
err = fn()
if err != nil {
metrics.CacheErrors.With(labels).Inc()
l := logger
Expand Down

0 comments on commit 9ff1739

Please sign in to comment.