enhance(wip): error handle

This commit is contained in:
Jacky 2025-01-24 16:37:45 +08:00
parent 3f95ae5d90
commit 650196d06a
No known key found for this signature in database
GPG key ID: 215C21B10DF38B4D
93 changed files with 5228 additions and 3738 deletions

8
internal/nginx/errors.go Normal file
View file

@ -0,0 +1,8 @@
package nginx
import "github.com/uozi-tech/cosy"
var (
e = cosy.NewErrorScope("nginx")
ErrBlockIsNil = e.New(50001, "block is nil")
)

View file

@ -155,7 +155,7 @@ func buildComment(c []string) string {
func parse(block config.IBlock, ngxConfig *NgxConfig) (err error) {
if block == nil {
err = errors.New("block is nil")
err = ErrBlockIsNil
return
}
for _, v := range block.GetDirectives() {