horde / exception
Exception handler library
v3.0.0beta5
2026-04-17 00:00 UTC
Requires
- php: ^7.4 || ^8
- horde/translation: ^3 || dev-FRAMEWORK_6_0
Requires (Dev)
- horde/test: ^3 || dev-FRAMEWORK_6_0
This package is auto-updated.
Last update: 2026-04-17 11:29:10 UTC
README
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.
Installation
composer require horde/exception
Quick Start
use 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(); }
Choosing an Exception Base Class
| 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.
Documentation
- 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
License
LGPL-2.1-only. See LICENSE for details.