mirror of
https://git.lolcat.ca/lolcat/4get.git
synced 2024-11-08 17:43:07 -05:00
additional qwant error handling
This commit is contained in:
parent
bad8d7ad50
commit
f8d46df1e8
1 changed files with 15 additions and 0 deletions
|
@ -659,6 +659,11 @@ class qwant{
|
||||||
throw new Exception("Qwant returned an API error");
|
throw new Exception("Qwant returned an API error");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if(isset($json["data"]["result"]["items"]["mainline"])){
|
||||||
|
|
||||||
|
throw new Exception("Qwant returned gibberish results");
|
||||||
|
}
|
||||||
|
|
||||||
$out = [
|
$out = [
|
||||||
"status" => "ok",
|
"status" => "ok",
|
||||||
"npt" => null,
|
"npt" => null,
|
||||||
|
@ -754,6 +759,11 @@ class qwant{
|
||||||
throw new Exception("Qwant returned an API error");
|
throw new Exception("Qwant returned an API error");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if(isset($json["data"]["result"]["items"]["mainline"])){
|
||||||
|
|
||||||
|
throw new Exception("Qwant returned gibberish results");
|
||||||
|
}
|
||||||
|
|
||||||
$out = [
|
$out = [
|
||||||
"status" => "ok",
|
"status" => "ok",
|
||||||
"npt" => null,
|
"npt" => null,
|
||||||
|
@ -856,6 +866,11 @@ class qwant{
|
||||||
throw new Exception("Qwant returned an API error");
|
throw new Exception("Qwant returned an API error");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if(isset($json["data"]["result"]["items"]["mainline"])){
|
||||||
|
|
||||||
|
throw new Exception("Qwant returned gibberish results");
|
||||||
|
}
|
||||||
|
|
||||||
$out = [
|
$out = [
|
||||||
"status" => "ok",
|
"status" => "ok",
|
||||||
"npt" => null,
|
"npt" => null,
|
||||||
|
|
Loading…
Reference in a new issue