Skip to content

Commit e78345b

Browse files
committed
[Fix typo in docs] catch Client errors and print it 🐞
1 parent c2a78dd commit e78345b

File tree

1 file changed

+18
-10
lines changed

1 file changed

+18
-10
lines changed

README.md

Lines changed: 18 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -91,17 +91,25 @@ Sending to one device [Transactional]
9191
------------
9292

9393
```php
94+
use GuzzleHttp\Exception\ClientException;
95+
use GuzzleHttp\Psr7;
96+
......
9497
//Sample sending campaign to an alias
95-
$client->transactional->send([
96-
// iOS and Android only supported
97-
//0 => iOS
98-
//1 => Android
99-
"platform" => 0,
100-
//token
101-
"token" => "71e7aef2f01d055b11c958dc48d06a655541b054196dd33b071777e1557dcb48",
102-
//Message
103-
"msg" => "Notification message"
104-
]);
98+
try {
99+
$client->transactional->send([
100+
// iOS and Android only supported
101+
//0 => iOS
102+
//1 => Android
103+
"platform" => 0,
104+
//token
105+
"token" => "343aa292e2bb642db2abb24124417cdf945a03e18c9434499d0dcef8b0d7dd0f",
106+
//Message
107+
"msg" => "Notification message"
108+
]);
109+
} catch (ClientException $e) {
110+
echo Psr7\str($e->getRequest());
111+
echo Psr7\str($e->getResponse());
112+
}
105113
```
106114

107115
Changelog

0 commit comments

Comments
 (0)