Skip to content

Commit

Permalink
Set correct error env when put distributions (#538)
Browse files Browse the repository at this point in the history
  • Loading branch information
okomio authored Jun 28, 2023
1 parent 10f5e51 commit 2eee864
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion pkg/handler/crud.go
Original file line number Diff line number Diff line change
Expand Up @@ -574,7 +574,7 @@ func (c *crud) PutDistributions(params distribution.PutDistributionsParams) midd
err1 := tx.Create(&d).Error
if err1 != nil {
tx.Rollback()
return distribution.NewPutDistributionsDefault(500).WithPayload(ErrorMessage("%s", err))
return distribution.NewPutDistributionsDefault(500).WithPayload(ErrorMessage("%s", err1))
}
}
err = tx.Commit().Error
Expand Down

0 comments on commit 2eee864

Please sign in to comment.