juanchosl/exceptions

A small, lightweight collection of Exceptions that are using the standard status codes for use on requests

1.0.5 2025-05-23 19:59 UTC

This package is auto-updated.

Last update: 2025-05-23 20:00:54 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