From db0a5e7f27a6683049c90dcd215d9844791853ff Mon Sep 17 00:00:00 2001 From: Cres Jie Date: Wed, 15 Mar 2023 22:11:17 +0800 Subject: [PATCH 1/3] Update RollbarLogger.php fix if message is not set --- src/RollbarLogger.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/RollbarLogger.php b/src/RollbarLogger.php index ab5dbe50..ab30d8d0 100644 --- a/src/RollbarLogger.php +++ b/src/RollbarLogger.php @@ -118,7 +118,7 @@ public function log($level, $toLog, array $context = array(), $isUncaught = fals $this->verboseLogger()->error('Occurrence rejected by the SDK: ' . $response); } elseif ($response->getStatus() >= 400) { $info = $response->getInfo(); - $this->verboseLogger()->error('Occurrence rejected by the API: ' . $info['message']); + $this->verboseLogger()->error('Occurrence rejected by the API: ' . ($info['message'] ?? 'message not set') ); } else { $this->verboseLogger()->info('Occurrence successfully logged'); } From d5b0bc4893434d9a95172bc168da05b47fc5d256 Mon Sep 17 00:00:00 2001 From: Cres Jie Date: Mon, 20 Mar 2023 11:29:28 +0800 Subject: [PATCH 2/3] Added fallback message to Rollbar API rejection verbose log --- src/RollbarLogger.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/RollbarLogger.php b/src/RollbarLogger.php index ab30d8d0..994fdf00 100644 --- a/src/RollbarLogger.php +++ b/src/RollbarLogger.php @@ -118,7 +118,7 @@ public function log($level, $toLog, array $context = array(), $isUncaught = fals $this->verboseLogger()->error('Occurrence rejected by the SDK: ' . $response); } elseif ($response->getStatus() >= 400) { $info = $response->getInfo(); - $this->verboseLogger()->error('Occurrence rejected by the API: ' . ($info['message'] ?? 'message not set') ); + $this->verboseLogger()->error('Occurrence rejected by the API: ' . (isset($info['message']) ? $info['message'] : 'message not set')); } else { $this->verboseLogger()->info('Occurrence successfully logged'); } From 954f5bc6a8ad237a22a43ba2ae37dde757d8eea2 Mon Sep 17 00:00:00 2001 From: Daniel Morell Date: Wed, 22 Mar 2023 05:34:38 -0500 Subject: [PATCH 3/3] Fixed line too long --- src/RollbarLogger.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/RollbarLogger.php b/src/RollbarLogger.php index 994fdf00..dfeb8695 100644 --- a/src/RollbarLogger.php +++ b/src/RollbarLogger.php @@ -118,7 +118,9 @@ public function log($level, $toLog, array $context = array(), $isUncaught = fals $this->verboseLogger()->error('Occurrence rejected by the SDK: ' . $response); } elseif ($response->getStatus() >= 400) { $info = $response->getInfo(); - $this->verboseLogger()->error('Occurrence rejected by the API: ' . (isset($info['message']) ? $info['message'] : 'message not set')); + $this->verboseLogger()->error( + 'Occurrence rejected by the API: ' . (isset($info['message']) ? $info['message'] : 'message not set') + ); } else { $this->verboseLogger()->info('Occurrence successfully logged'); }