From d22adb0e09472422955f00cc0b7688c448ffe4ac Mon Sep 17 00:00:00 2001 From: philipp lang Date: Sun, 5 Jul 2020 01:40:35 +0200 Subject: [PATCH] Fixed: Log error in member request --- src/Api.php | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/src/Api.php b/src/Api.php index 0358ff7..856ef0d 100644 --- a/src/Api.php +++ b/src/Api.php @@ -110,17 +110,16 @@ class Api { $url = self::$url.'/ica/rest/nami/mitglied/filtered-for-navigation/gruppierung/gruppierung/'.$groupId.'/'.$memberId; $response = $this->http()->get($url); - Log::debug('Member Request '.$memberId, [ - 'url' => $url, - 'response' => $response->body(), - 'json' => $response->json() - ]); + if ($response->status() == 200) { + Log::debug('Member Request '.$memberId, [ 'url' => $url, 'response' => $response->body(), 'json' => $response->json(), 'memberId' => $memberId ]); + } else { + Log::error('Member Request '.$memberId, [ 'url' => $url, 'response' => $response->body(), 'json' => $response->json(), 'memberId' => $memberId ]); + } if ($response->json()['success'] === true) { return $response->json()['data']; } - if(Str::startsWith($response['message'], 'Access denied')) { return $this->singleMemberFallback($groupId, $memberId); }