wraps the given error
(err error)
| 410 | |
| 411 | // wraps the given error |
| 412 | func handleError(err error) error { |
| 413 | // If the error is a constraint error, we return a more specific error to indicate the client that's a duplicate |
| 414 | if ent.IsConstraintError(err) { |
| 415 | return biz.NewErrAlreadyExists(err) |
| 416 | } |
| 417 | |
| 418 | return err |
| 419 | } |
| 420 | |
| 421 | func latestVersion(ctx context.Context, contract *ent.WorkflowContract) (*ent.WorkflowContractVersion, error) { |
| 422 | return contract.QueryVersions().Order(ent.Desc(workflowcontractversion.FieldRevision)).First(ctx) |
no test coverage detected