Exception handling library for the Horde Project.
Provides a set of exception base classes that integrate with the Horde
framework. All exceptions implement HordeThrowable (details support) and
LogThrowable (log-level tracking), and extend PHP's SPL exception hierarchy
for proper semantic categorisation.
composer require horde/exceptionuse Horde\Exception\HordeRuntimeException;
use Horde\Exception\HordeThrowable;
// Throw a typed exception
throw new HordeRuntimeException('Connection failed', 0, $previous);
// Catch any Horde exception via the interface
try {
// ...
} catch (HordeThrowable $e) {
echo $e->getMessage();
echo $e->getDetails();
}| Error type | Base class |
|---|---|
| Runtime / I/O failure | HordeRuntimeException |
| Invalid argument from caller | HordeInvalidArgumentException |
| Programmer logic error | HordeLogicException |
| Domain rule violation | HordeDomainException |
| Resource not found | NotFound |
| Permission denied | PermissionDenied |
| Generic / uncategorised | HordeException |
Component exceptions should extend the SPL-based class that best fits
(e.g. class CacheException extends HordeRuntimeException {}).
See doc/USAGE.md for the full use-case table, guidance on
Wrapped vs standard exceptions, and component exception patterns.
- doc/USAGE.md — Choosing the right base class, the
Wrappedpitfall, creating component exceptions - doc/UPGRADING.md — Migrating from PSR-0 to PSR-4, class mapping table, breaking changes
LGPL-2.1-only. See LICENSE for details.