Skip to content

Commit d41a91f

Browse files
committed
readme
1 parent 80d496a commit d41a91f

File tree

1 file changed

+10
-2
lines changed

1 file changed

+10
-2
lines changed

README.md

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
This provides an OpenAPI schema and an auto-generated PHP client as a composer package.
44

5-
> [!NOTE]
5+
> [!WARNING]
66
> This is not an official package.
77
88
## Requirements
@@ -49,10 +49,18 @@ $client->api()->doApplePay(...);
4949

5050
SimplePay responses with `HTTP 200` even if the operation is failed or an error occured. The handle this properly the Client has a built-in middleware that checks whether the response contains any errors, if so, it throws an `ApiException`.
5151

52+
The message holds the error code and the error message to make easier debugging.
53+
5254
```php
55+
use Cone\SimplePay\ApiException;
56+
5357
try {
5458
$client->api()->start(...);
5559
} catch (ApiException $exception) {
56-
Log::info()
60+
// Log the message (starting with the error code)
61+
Log::info($exception->getMessage());
62+
63+
// Log the error code only
64+
Log::info($exception->getCode());
5765
}
5866
```

0 commit comments

Comments
 (0)