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

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