enhance: replace error handling with cosy wrapper for nginx reload and test failures

This commit is contained in:
Jacky 2025-04-18 08:06:34 +00:00
parent c5e80fb98a
commit d789326230
No known key found for this signature in database
GPG key ID: 215C21B10DF38B4D
14 changed files with 57 additions and 43 deletions

View file

@ -76,9 +76,7 @@ func AddConfig(c *gin.Context) {
output := nginx.Reload()
if nginx.GetLogLevel(output) >= nginx.Warn {
c.JSON(http.StatusInternalServerError, gin.H{
"message": output,
})
cosy.ErrHandler(c, cosy.WrapErrorWithParams(config.ErrNginxReloadFailed, output))
return
}