imemento/exceptions

HTTP Exceptions

v8.1.0 2021-07-25 08:32 UTC

This package is auto-updated.

Last update: 2024-04-26 19:40:25 UTC


README

Build Status Latest Stable Version License Total Downloads

This package provides some common exceptions to be used in all iMemento Services.

Install

composer require imemento/exceptions

Usage

throw new ResourceException($message, $debug, $code, $previous);

All our exceptions that extend the HttpException class have a unique id, optional debug info and an error code. They will be mapped to a specific response from http-responses using our custom error handler.

Errors

Exception Status Code
iMemento\Exceptions\Exception 1000
iMemento\Exceptions\InvalidTokenException 1001
iMemento\Exceptions\ExpiredAuthTokenException 1002
iMemento\Exceptions\ExpiredPermsTokenException 1003
iMemento\Exceptions\ExpiredConsumerTokenException 1004
iMemento\Exceptions\MissingTokenException 1005
iMemento\Exceptions\MissingRoleException 1010
iMemento\Exceptions\MissingSessionException 1020
iMemento\Exceptions\MissingParameterException 1030
iMemento\Exceptions\ResourceException 1100
iMemento\Exceptions\StoreResourceFailedException 1101
iMemento\Exceptions\UpdateResourceFailedException 1102
iMemento\Exceptions\DeleteResourceFailedException 1103