github.com/tencent/goom@v1.0.1/erro/arg_not_found.go (about)

     1  package erro
     2  
     3  import "strconv"
     4  
     5  // ArgNotFound 参数未找到异常
     6  type ArgNotFound struct {
     7  	funcName string
     8  	arg      int
     9  }
    10  
    11  // Error 返回错误字符串
    12  func (e *ArgNotFound) Error() string {
    13  	return "arg not found: " + e.funcName + ":" + strconv.Itoa(e.arg)
    14  }
    15  
    16  // NewArgNotFoundError 函数未找到
    17  // funcName 函数名称
    18  // index 参数下标
    19  func NewArgNotFoundError(funcName string, index int) error {
    20  	return &ArgNotFound{funcName: funcName, arg: index}
    21  }