juanchosl / exceptions
A small, lightweight collection of Exceptions that are using the standard status codes for use on requests
Installs: 362
Dependents: 13
Suggesters: 0
Security: 0
Stars: 0
Watchers: 1
Forks: 0
pkg:composer/juanchosl/exceptions
Requires
- php: ^7.1 || ^8.0
- fig/http-message-util: 1.1.*
Requires (Dev)
- phpunit/phpunit: 9.6.*
This package is auto-updated.
Last update: 2025-09-29 17:52:41 UTC
README
Description
A small, lightweight collection of Exceptions that are using the standard status codes for use on requests
Install
composer require juanchosl/exceptions
How use it
Load composer autoload and use the JuanchoSL\Exceptions{EXCEPTION} class
if(!files_exists($full_path)){ throw new NotFoundException("The file '{$full_path}' does not exists"); }
Available Code exceptions
| Code | Class |
|---|---|
| 304 | NotModifiedException |
| 400 | BadRequestException |
| 401 | UnauthorizedException |
| 402 | PaymentRequiredException |
| 403 | ForbiddenException |
| 404 | NotFoundException |
| 405 | MethodNotAllowedException |
| 408 | DestinationUnreachableException |
| 409 | ConflictException |
| 412 | PreconditionFailedException |
| 415 | UnsupportedMediaTypeException |
| 416 | RangeNotSatisfiableException |
| 417 | ExpectationFailedException |
| 422 | UnprocessableEntityException |
| 423 | LockedException |
| 428 | PreconditionRequiredException |
| 501 | NotImplementedException |
| 503 | ServiceUnavailableException |