mirror of
				https://github.com/TeaOSLab/EdgeCommon.git
				synced 2025-11-04 21:50:26 +08:00 
			
		
		
		
	优化错误处理相关代码
This commit is contained in:
		@@ -3,7 +3,7 @@
 | 
				
			|||||||
package shared
 | 
					package shared
 | 
				
			||||||
 | 
					
 | 
				
			||||||
import (
 | 
					import (
 | 
				
			||||||
	"errors"
 | 
						"fmt"
 | 
				
			||||||
	"regexp"
 | 
						"regexp"
 | 
				
			||||||
	"strings"
 | 
						"strings"
 | 
				
			||||||
)
 | 
					)
 | 
				
			||||||
@@ -50,7 +50,7 @@ func (this *URLPattern) Init() error {
 | 
				
			|||||||
		}
 | 
							}
 | 
				
			||||||
		reg, err := regexp.Compile(pattern)
 | 
							reg, err := regexp.Compile(pattern)
 | 
				
			||||||
		if err != nil {
 | 
							if err != nil {
 | 
				
			||||||
			return errors.New("compile '" + pattern + "' failed: " + err.Error())
 | 
								return fmt.Errorf("compile '%s' failed: %w", pattern, err)
 | 
				
			||||||
		}
 | 
							}
 | 
				
			||||||
		this.reg = reg
 | 
							this.reg = reg
 | 
				
			||||||
	}
 | 
						}
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user