Skip to content

Commit

Permalink
📝 Update styling in doc
Browse files Browse the repository at this point in the history
  • Loading branch information
tgeorgel committed Jan 27, 2023
1 parent de25a13 commit 167478c
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -199,21 +199,24 @@ By default, the Request will throw a `\Illuminate\Http\Client\RequestException`

```php
/**
* @return \Bluerock\Sellsy\Models\Contact|false
* @return \Bluerock\Sellsy\Entities\Contact|false
* @throws \Illuminate\Http\Client\RequestException
*/
public function maybeFindMyContact($contact_id)
{
try {
return Bluerock\Sellsy\Core\Client::contacts()->show($contact_id)->entity();
return Bluerock\Sellsy\Core\Client::contacts()
->show($contact_id)
->entity();

# catch the RequestException and return false if the contact is not found.
# catch the RequestException
} catch (\Illuminate\Http\Client\RequestException $e) {
# return false if the contact is not found (404 error).
if ($e->response->status() === 404) {
return false;
}

throw $e;
throw $e;
}
}
```
Expand Down

0 comments on commit 167478c

Please sign in to comment.