Skip to content

Commit a7bb461

Browse files
committed
return error in NOK verify status
1 parent cef774c commit a7bb461

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

arcaptcha.go

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ package arcaptcha
33
import (
44
"bytes"
55
"encoding/json"
6+
"fmt"
67
"io/ioutil"
78
"net/http"
89
)
@@ -82,6 +83,9 @@ func sendRequest(method, url string, data interface{}, resp interface{}) error {
8283
if err != nil {
8384
return err
8485
}
86+
if res.StatusCode != http.StatusOK {
87+
return fmt.Errorf("%v: %v", res.Status, string(bin))
88+
}
8589
if err = json.Unmarshal(bin, resp); err != nil {
8690
return err
8791
}

0 commit comments

Comments
 (0)