docs/config-reference/stop-on-failure.md
# Stop on failure <Badge type="tip" text="2.7.0+" />
<small>📝 Name: `stopOnFailure` · 🖥️ Option: `--stop-on-failure`</small>
> Cancel further cache warmup requests on failure.
::: info
This option only apply to [stoppable crawlers](../api/stoppable-crawler.md).
If the configured crawler does not implement the required interface, a warning
is shown.
:::
## Example
Enable the flag to immediately stop crawling on failure.
::: code-group
```bash [CLI]
./cache-warmup.phar --stop-on-failure
```
```json [JSON]
{
"stopOnFailure": true
}
```
```php [PHP]
use EliasHaeussler\CacheWarmup;
return static function (CacheWarmup\Config\CacheWarmupConfig $config) {
$config->stopOnFailure();
return $config;
};
```
```yaml [YAML]
stopOnFailure: true
```
```bash [.env]
CACHE_WARMUP_STOP_ON_FAILURE=1
```
:::