Skip to content

Commit 535426d

Browse files
authored
Update README.md - added info how to extract json from error response
1 parent 5a730d2 commit 535426d

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

README.md

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -212,3 +212,13 @@ $response = $api->file()->get($entityId);
212212
```php
213213
$json = $api->*()->getAsJson($response);
214214
```
215+
216+
### get JSON from Error Response
217+
218+
```php
219+
try {
220+
$api->*->*();
221+
} catch(\Clicksports\LexOffice\Exceptions\LexOfficeApiException $exception) {
222+
$json = $api->*()->getAsJson($exception->getPrevious()->getResponse());
223+
}
224+
```

0 commit comments

Comments
 (0)