You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
New TelemetryEvent cannot handle nested array as $body argument #648
I'm using the newest release of the Laravel PHP package which uses the 4.1.0 version of this package. This version can result in the following error:
Named parameter $message overwrites previous argument {"exception":"[object] (Error(code: 0): Named parameter $message overwrites previous argument at vendor/rollbar/rollbar/src/Payload/TelemetryEvent.php:50)
This error is thrown if the body argument of the TelemetryEvent __construct function is a nested array. For example (when using the Laravel-Rollbar package):
Log::info('This throws an error', [["data" => "some data]]);
The error is caused by the top-level nested array. This worked before, so this is regression of functionality.
Simple replication
To replicate you can do the following, which is simple direct replication of what happens in the constructor of the TelemetryEvent class.
// This throws an error
$event = new TelemetryBody(...[['data' => 'some_data']]);
One lever higher up, there is a restriction on what is allowed in the array of the body. The following will cause an error:
Activity
linear commentedon Mar 18, 2025
SDK-455 New TelemetryEvent cannot handle nested array as $body argument
Fixed #648 TelemetryEvent cannot handle nested array as $body argument.
Merge pull request #649 from rollbar/fixed/issue-648-error-from-neste…