# Exceptions

Every exception in our library is extended from:

```php
\SimPay\Laravel\Exceptions\SimPayException
```

* When response from our API is 401 or 403, `\SimPay\Laravel\Exceptions\AuthorizationException` is thrown;
* When response from our API is 404, `\SimPay\Laravel\Exceptions\ResourceNotFoundException` is thrown (this will be also thrown, when SMS code does not exists);
* When response from our API is 422, `\SimPay\Laravel\Exceptions\ValidationFailedException` is thrown (you can get errors by using `$exception->errors()`.

If SimPayException is thrown, you may see `errorCode`, which may be useful for specific errors returned (eg. BLIK Alias already registered, invalid BLIK T6 code).

* errorCode may be a string or null


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://simpaypl.gitbook.io/simpay-laravel/exceptions.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
