]> git.mxchange.org Git - friendica-addons.git/commitdiff
No need to fetch the return data since we don't use it
authorMichael <heluecht@pirati.ca>
Sun, 9 Apr 2023 05:06:52 +0000 (05:06 +0000)
committerMichael <heluecht@pirati.ca>
Sun, 9 Apr 2023 05:06:52 +0000 (05:06 +0000)
tumblr/tumblr.php

index 7642c5d7572ffcd44be4c278a1adbef6c8db40bc..906fdc5359af1c78d02bf43f4349c9cf27a69f68 100644 (file)
@@ -510,8 +510,8 @@ function tumblr_get($connection, string $url)
                $data    = json_decode($res->getBody()->getContents());
        } catch (RequestException $exception) {
                $success = false;
+               $data    = [];
                Logger::notice('Request failed', ['code' => $exception->getCode(), 'message' => $exception->getMessage()]);
-               $data    = json_decode($exception->getResponse()->getBody()->getContents());
        }
        return ['success' => $success, 'data' => $data];
 }
@@ -525,8 +525,8 @@ function tumblr_post($connection, string $url, array $parameter)
                $data    = json_decode($res->getBody()->getContents());
        } catch (RequestException $exception) {
                $success = false;
-               Logger::notice('Post failed', ['code' => $exception->getCode(), 'message' => $exception->getMessage()]);
                $data    = json_decode($exception->getResponse()->getBody()->getContents());
+               Logger::notice('Post failed', ['code' => $exception->getCode(), 'message' => $exception->getMessage()]);
        }
        return ['success' => $success, 'data' => $data];
 }
\ No newline at end of file