mirror of
https://git.lolcat.ca/lolcat/4get.git
synced 2024-11-14 03:49:48 +01:00
brave error handling
This commit is contained in:
parent
640d1d1953
commit
77931f3ee9
|
@ -422,6 +422,19 @@ class brave{
|
|||
throw new Exception("Failed to decode JavaScript object");
|
||||
}
|
||||
|
||||
if(
|
||||
isset($data[2]["data"]["title"]) &&
|
||||
stripos($data[2]["data"]["title"], "PoW Captcha") !== false
|
||||
){
|
||||
|
||||
throw new Exception("Brave returned a PoW captcha");
|
||||
}
|
||||
|
||||
if(!isset($data[1]["data"]["body"]["response"])){
|
||||
|
||||
throw new Exception("Brave did not return a result object");
|
||||
}
|
||||
|
||||
$data = $data[1]["data"]["body"]["response"];
|
||||
|
||||
/*
|
||||
|
|
Loading…
Reference in a new issue