mirror of
https://github.com/Buriburizaem0n/nezha_domains.git
synced 2026-02-04 12:40:07 +00:00
use plain error type for expected behaviors (#447)
This commit is contained in:
@@ -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