Skip to content

Commit

Permalink
fix: Revise response status code of create device API
Browse files Browse the repository at this point in the history
fixes #5018

Signed-off-by: Jack Chen <[email protected]>
  • Loading branch information
jackchenjc committed Dec 10, 2024
1 parent 2eb6d4b commit c33ac6e
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion internal/core/metadata/application/device.go
Original file line number Diff line number Diff line change
Expand Up @@ -369,7 +369,7 @@ func validateProfileAndAutoEvent(dic *di.Container, d models.Device) errors.Edge
dbClient := container.DBClientFrom(dic.Get)
dp, err := dbClient.DeviceProfileByName(d.ProfileName)
if err != nil {
return errors.NewCommonEdgeX(errors.Kind(err), fmt.Sprintf("device profile '%s' not found during validating device '%s'", d.ProfileName, d.Name), err)
return errors.NewCommonEdgeX(errors.KindContractInvalid, fmt.Sprintf("device profile '%s' not found during validating device '%s'", d.ProfileName, d.Name), err)
}
if len(d.AutoEvents) == 0 {
return nil
Expand Down

0 comments on commit c33ac6e

Please sign in to comment.