# ContentException

Learn how to handle the error thrown when content cannot be fetched.

This exception is thrown when content cannot be fetched and no fallback is available. It implements [`CroctException`](croct-exception).

## Example

This example falls back to a default when the content cannot be fetched:

```php
<?php
use Croct\Plug\Croct;
use Croct\Plug\Exception\ContentException;

$croct = Croct::fromDotenv();

try {
    $content = $croct->fetchContent('home-banner');
} catch (ContentException $error) {
    $content = ['title' => 'Welcome to Croct!'];
}
```
