---
title: "Exceptions — Reports for Laravel | Roundly"
description: "The typed exceptions the package throws — all extending ReportsException — and the context each one carries."
url: https://roundly-consulting.com/open-source/docs/reports-for-laravel/exceptions
language: en
---

[All packages](https://roundly-consulting.com/open-source.md)

[Reports for Laravel](https://roundly-consulting.com/open-source/docs/reports-for-laravel.md)

# Exceptions

Every package exception extends ReportsException, itself a RuntimeException, so you can catch them individually or together:

| Exception | Thrown when | Carries |
| --- | --- | --- |
| `DuplicateReportException` | prevent\_duplicates blocks a repeat report. | existing |
| `InvalidStatusTransitionException` | A status move — changeStatus(), review(), close(), changeStatusTo(), resolve or reject — is undeclared while strict\_transitions is on. | report, from, to |
| `UnknownReportReasonException` | The reason is not in the allowed list and allow\_unknown\_reasons is false. | slug, allowed |
| `MissingModeratorsException` | Reports::moderate(...)->open() is called without moderators. | — |
| `ModerationNotAllowedException` | Reports::moderate(...)->open() is called on a settled report or one with a pending moderation request. Nothing is opened. | report |
| `ModeratorRequiredException` | A report under moderation is resolved, rejected or moved out of the open statuses by anyone but a named moderator (or a delegate of one), or without an actor. Nothing is written. | report, actor |
| `MissingPruneWindowException` | Reports::prune() runs with no $days and no prune\_after\_days. | — |
| `ReportsException` | Base class of all of the above; extends RuntimeException. | — |

```php
use RoundlyConsulting\Reports\Exceptions\ReportsException;
use RoundlyConsulting\Reports\Exceptions\UnknownReportReasonException;

try {
    Reports::report($post)->by($user)->for($slug)->create();
} catch (UnknownReportReasonException $e) {
    $e->slug;     // the rejected slug
    $e->allowed;  // list<string> — the allowed slugs
} catch (ReportsException $e) {
    // any other package exception, e.g. DuplicateReportException
}
```

Creating a report without a subject — a PendingReport started with Reports::from() and no about() — or against an unsaved subject or by an unsaved reporter throws a plain LogicException, and nothing is written.

Two failures come from the packages underneath and do not extend ReportsException: an invalid config value — threshold, prune\_after\_days, the moderation defaults, duplicate\_scope, table, reasons, key\_type, primary\_key\_type or model (see Configuration) — throws the toolkit’s InvalidConfigurationException, and opening moderation with an unsaved moderator or a quorum above the moderator count throws the approvals engine’s InvalidApprovalRequestException.

## Show your open-source love

This package is free and MIT-licensed. If it saves you time, a one-off donation or a Patreon membership keeps it maintained, tested and documented.

[More ways to support, including crypto](https://roundly-consulting.com/support-us.md)

By donating, you agree to our [donation terms](https://roundly-consulting.com/donation-terms.md).

[Support our open source work (opens in a new tab)](https://donate.stripe.com/dRmeVe8FX5PF1Qd9pXcEw00) [Join us on Patreon (opens in a new tab)](https://www.patreon.com/cw/roundly)

## Want this built into your product?

We integrate our packages into custom Laravel and AI builds. Tell us what you're working on and we'll reply within 48 hours.

[Get a quote in 48 hours](https://roundly-consulting.com/contact.md) [Browse all packages](https://roundly-consulting.com/open-source/docs/reports-for-laravel.md)
