enhance: error handling #993

This commit is contained in:
Jacky 2025-04-30 09:20:46 +08:00
parent e77fd308e2
commit 163a84864a
No known key found for this signature in database
GPG key ID: 215C21B10DF38B4D
22 changed files with 793 additions and 718 deletions

View file

@ -26,13 +26,13 @@ func GetSiteList(c *gin.Context) {
configFiles, err := os.ReadDir(nginx.GetConfPath("sites-available"))
if err != nil {
cosy.ErrHandler(c, err)
cosy.ErrHandler(c, cosy.WrapErrorWithParams(site.ErrReadDirFailed, err.Error()))
return
}
enabledConfig, err := os.ReadDir(nginx.GetConfPath("sites-enabled"))
if err != nil {
cosy.ErrHandler(c, err)
cosy.ErrHandler(c, cosy.WrapErrorWithParams(site.ErrReadDirFailed, err.Error()))
return
}