We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent d21aea2 commit 29f1d8cCopy full SHA for 29f1d8c
lib/Message.php
@@ -43,6 +43,10 @@ public static function parse(string $msg): Message
43
44
public function __toString(): string
45
{
46
- return json_encode($this);
+ $encoded = json_encode($this);
47
+ if ($encoded === false) {
48
+ throw new Error(json_last_error_msg(), ErrorCode::INTERNAL_ERROR);
49
+ }
50
+ return $encoded;
51
}
52
0 commit comments