Skip to content

Commit

Permalink
add: default scope and error codes mapping
Browse files Browse the repository at this point in the history
  • Loading branch information
bbx-winner committed Jul 13, 2023
1 parent d64f615 commit fc23e4c
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 1 deletion.
6 changes: 6 additions & 0 deletions hrp/internal/code/code.go
Original file line number Diff line number Diff line change
Expand Up @@ -141,6 +141,12 @@ var errorsMap = map[error]int{
OCRServiceConnectionError: 82,
OCRResponseError: 83,
OCRTextNotFoundError: 84,

CVEnvMissedError: 90,
CVRequestError: 91,
CVServiceConnectionError: 92,
CVResponseError: 93,
CVImageNotFoundError: 94,
}

func IsErrorPredefined(err error) bool {
Expand Down
2 changes: 1 addition & 1 deletion hrp/internal/version/VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
v4.3.3.2306281303
v4.3.3.2307131714
3 changes: 3 additions & 0 deletions hrp/pkg/uixt/ext.go
Original file line number Diff line number Diff line change
Expand Up @@ -613,6 +613,9 @@ func (dExt *DriverExt) DoAction(action MobileAction) error {
}
return fmt.Errorf("invalid %s params: %v", ACTION_TapByOCR, action.Params)
case ACTION_TapByCV:
if len(action.Scope) != 4 {
action.Scope = []float64{0, 0, 1, 1}
}
if imagePath, ok := action.Params.(string); ok {
return dExt.TapByCV(
imagePath,
Expand Down

0 comments on commit fc23e4c

Please sign in to comment.