mirror of
https://github.com/Buriburizaem0n/nezha_domains.git
synced 2026-11-04 08:40:20 +00:00
use plain error type for expected behaviors (#447)
This commit is contained in:
1 parent
05b716d80f
commit
08dea15cbf
3 files changed
+5
-4
No files matched your search
@@ -1,6 +1,7 @@
|
||||
package controller
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"net/http"
|
||||
"strconv"
|
||||
|
||||
@@ -36,7 +37,7 @@ func editServer(c *gin.Context) error {
|
||||
|
||||
var s model.Server
|
||||
if err := singleton.DB.First(&s, id).Error; err != nil {
|
||||
return newGormError("%v", err)
|
||||
return fmt.Errorf("server id %d does not exist", id)
|
||||
}
|
||||
|
||||
s.Name = sf.Name
|
||||
|
||||
Reference in new issue
Block a user