mirror of
https://github.com/0xJacky/nginx-ui.git
synced 2025-05-11 18:35:51 +02:00
enhance(wip): error handle
This commit is contained in:
parent
3f95ae5d90
commit
650196d06a
93 changed files with 5228 additions and 3738 deletions
8
internal/nginx/errors.go
Normal file
8
internal/nginx/errors.go
Normal 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")
|
||||
)
|
|
@ -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() {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue