mirror of
https://github.com/httprunner/httprunner.git
synced 2026-07-09 06:23:52 +08:00
feat: add exit code LoopActionNotFoundError
This commit is contained in:
@@ -80,11 +80,12 @@ var (
|
|||||||
|
|
||||||
// OCR related: [80, 90)
|
// OCR related: [80, 90)
|
||||||
var (
|
var (
|
||||||
OCREnvMissedError = errors.New("OCR env missed error") // 80
|
OCREnvMissedError = errors.New("OCR env missed error") // 80
|
||||||
OCRRequestError = errors.New("OCR prepare request error") // 81
|
OCRRequestError = errors.New("OCR prepare request error") // 81
|
||||||
OCRServiceConnectionError = errors.New("OCR service connect error") // 82
|
OCRServiceConnectionError = errors.New("OCR service connect error") // 82
|
||||||
OCRResponseError = errors.New("OCR parse response error") // 83
|
OCRResponseError = errors.New("OCR parse response error") // 83
|
||||||
OCRTextNotFoundError = errors.New("OCR text not found") // 84
|
OCRTextNotFoundError = errors.New("OCR text not found") // 84
|
||||||
|
LoopActionNotFoundError = errors.New("loop action not found error") // 85
|
||||||
)
|
)
|
||||||
|
|
||||||
// CV related: [90, 100)
|
// CV related: [90, 100)
|
||||||
@@ -146,6 +147,7 @@ var errorsMap = map[error]int{
|
|||||||
OCRServiceConnectionError: 82,
|
OCRServiceConnectionError: 82,
|
||||||
OCRResponseError: 83,
|
OCRResponseError: 83,
|
||||||
OCRTextNotFoundError: 84,
|
OCRTextNotFoundError: 84,
|
||||||
|
LoopActionNotFoundError: 85,
|
||||||
}
|
}
|
||||||
|
|
||||||
func IsErrorPredefined(err error) bool {
|
func IsErrorPredefined(err error) bool {
|
||||||
|
|||||||
@@ -84,7 +84,7 @@ func (dExt *DriverExt) LoopUntil(findAction, findCondition, foundAction Action,
|
|||||||
time.Sleep(time.Duration(1000*interval) * time.Millisecond)
|
time.Sleep(time.Duration(1000*interval) * time.Millisecond)
|
||||||
}
|
}
|
||||||
|
|
||||||
return errors.Wrap(code.OCRTextNotFoundError,
|
return errors.Wrap(code.LoopActionNotFoundError,
|
||||||
fmt.Sprintf("loop %d times, match find condition failed", maxRetryTimes))
|
fmt.Sprintf("loop %d times, match find condition failed", maxRetryTimes))
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user