fixed error message on incorrect api key
This commit is contained in:
parent
256648e682
commit
803ab459b1
1 changed files with 7 additions and 2 deletions
|
@ -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';
|
||||
|
|
Loading…
Reference in a new issue