Commit 74a3957f authored by Jack'lul's avatar Jack'lul

Improve logging in Botan integration

parent 1131a087
...@@ -194,7 +194,12 @@ class Botan ...@@ -194,7 +194,12 @@ class Botan
$responseData = json_decode($response, true); $responseData = json_decode($response, true);
if ($responseData['status'] !== 'accepted') { if ($responseData['status'] !== 'accepted') {
TelegramLog::debug("Botan.io API replied with error:\n$response\n\n"); if (!empty($response)) {
TelegramLog::debug("Botan.io track post failed, API reply:\n$response\n\n");
} else {
TelegramLog::debug("Botan.io track post failed, API returned empty response!\n\n");
}
return false; return false;
} }
...@@ -245,7 +250,12 @@ class Botan ...@@ -245,7 +250,12 @@ class Botan
BotanDB::insertShortUrl($user_id, $url, $response); BotanDB::insertShortUrl($user_id, $url, $response);
return $response; return $response;
} else { } else {
TelegramLog::error("Botan.io URL shortening failed - API replied with error:\n$response\n\n"); if (!empty($response)) {
TelegramLog::debug("Botan.io URL shortening failed for '$url', API reply:\n$response\n\n");
} else {
TelegramLog::debug("Botan.io URL shortening failed for '$url', API returned empty response!\n\n");
}
return $url; return $url;
} }
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment