This is an automated email from the ASF dual-hosted git repository.
lynwee pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/incubator-devlake.git
The following commit(s) were added to refs/heads/main by this push:
new 44ccba374 fix: optimize error messages when there are duplicate scope
configurations. (#7461)
44ccba374 is described below
commit 44ccba3748b95c6878c4eb8e22219bd5c9d06f5c
Author: abeizn <[email protected]>
AuthorDate: Mon May 13 14:34:02 2024 +0800
fix: optimize error messages when there are duplicate scope configurations.
(#7461)
---
backend/helpers/srvhelper/model_service_helper.go | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/backend/helpers/srvhelper/model_service_helper.go
b/backend/helpers/srvhelper/model_service_helper.go
index 3ec9abe39..70acbe446 100644
--- a/backend/helpers/srvhelper/model_service_helper.go
+++ b/backend/helpers/srvhelper/model_service_helper.go
@@ -103,7 +103,7 @@ func (srv *ModelSrvHelper[M]) Create(model *M) errors.Error
{
err = srv.db.Create(model)
if err != nil {
if srv.db.IsDuplicationError(err) {
- return errors.Conflict.Wrap(err, fmt.Sprintf("%s
already exists", srv.modelName))
+ return errors.Default.New("The name of the current
scope config is duplicated. Please modify it before saving.")
}
return err
}