fixed error message on incorrect api key

This commit is contained in:
KodeStar 2018-02-08 22:25:40 +00:00
parent 256648e682
commit 803ab459b1

View file

@ -9,7 +9,7 @@ class Sabnzbd implements Contracts\Applications, Contracts\Livestats {
public function defaultColour()
{
return '#655509';
return '#463b06';
}
public function icon()
{
@ -24,7 +24,12 @@ class Sabnzbd implements Contracts\Applications, Contracts\Livestats {
$res = $this->buildRequest('queue');
switch($res->getStatusCode()) {
case 200:
$data = json_decode($res->getBody());
if(isset($data->error) && !empty($data->error)) {
echo 'Failed: '.$data->error;
} else {
echo 'Successfully connected to the API';
}
break;
case 401:
echo 'Failed: Invalid credentials';