github.com/TeaOSLab/EdgeNode@v1.3.8/internal/iplibrary/action_errors.go (about)

     1  package iplibrary
     2  
     3  // FataError 是否是致命错误
     4  type FataError struct {
     5  	err string
     6  }
     7  
     8  func (this *FataError) Error() string {
     9  	return this.err
    10  }
    11  
    12  func NewFataError(err string) error {
    13  	return &FataError{err: err}
    14  }
    15  
    16  func IsFatalError(err error) bool {
    17  	if err == nil {
    18  		return false
    19  	}
    20  	_, ok := err.(*FataError)
    21  	return ok
    22  }