Skip to content

Commit af6e97c

Browse files
authored
Code example in README.md would throw an exception
The Rollbar Person class (Person::setId() -> Utilities::validateString()) expects the id to be a string and will throw an exception if it is an integer. The original Context Information block contains code that would cause an exception to be thrown (line 92). This code has been modified so as to not throw an exception by casting the id parameter to a string.
1 parent 8aec936 commit af6e97c

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,7 @@ You can pass user information as context like this:
8989

9090
```php
9191
\Log::error('Something went wrong', [
92-
'person' => ['id' => 123, 'username' => 'John Doe', 'email' => '[email protected]']
92+
'person' => ['id' =>(string) 123, 'username' => 'John Doe', 'email' => '[email protected]']
9393
]);
9494
```
9595

0 commit comments

Comments
 (0)