From c33ac6e24b313b0b45f411378b8aae79e9f71d55 Mon Sep 17 00:00:00 2001 From: Jack Chen Date: Tue, 10 Dec 2024 15:15:02 +0800 Subject: [PATCH] fix: Revise response status code of create device API fixes #5018 Signed-off-by: Jack Chen --- internal/core/metadata/application/device.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/internal/core/metadata/application/device.go b/internal/core/metadata/application/device.go index 3b139b3fff..72074a5956 100644 --- a/internal/core/metadata/application/device.go +++ b/internal/core/metadata/application/device.go @@ -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