Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion src/RollbarLogger.php
Original file line number Diff line number Diff line change
Expand Up @@ -269,7 +269,8 @@ public function report(
} elseif ($response->getStatus() >= 400) {
$info = $response->getInfo();
$this->verboseLogger()->error(
'Occurrence rejected by the API: ' . ($info['message'] ?? 'message not set')
'Occurrence rejected by the API: with status ' . $response->getStatus() . ': '
. ($info['message'] ?? 'message not set')
);
} else {
$this->verboseLogger()->info('Occurrence successfully logged');
Expand Down
6 changes: 3 additions & 3 deletions tests/VerbosityTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -227,13 +227,13 @@ public function testRollbarLoggerResponseStatusZero(): void
public function testRollbarLoggerResponseStatusError(): void
{
Rollbar::init([
'access_token' => $this->getTestAccessToken(),
// Invalid access token should cause a 403 response.
'access_token' => '00000000000000000000000000000000',
'environment' => 'testing-php',
'verbose_logger' => $this->verboseLogger,
'endpoint' => 'https://api.rollbar.com/api/foo/',
]);
Rollbar::log(LogLevel::INFO, "Testing PHP Notifier");
$this->assertVerboseLogContains('Occurrence rejected by the API:', LogLevel::ERROR);
$this->assertVerboseLogContains('Occurrence rejected by the API: with status 403: ', LogLevel::ERROR);
}

/**
Expand Down