2017 © Pedro Peláez
 

library except-io-nal

The Cloudoki PHP Exception extensions throw manageable errors in a multi-tier MQ alignment

image

cloudoki/except-io-nal

The Cloudoki PHP Exception extensions throw manageable errors in a multi-tier MQ alignment

  • Thursday, October 13, 2016
  • by koenbetsens
  • Repository
  • 5 Watchers
  • 0 Stars
  • 1,249 Installations
  • PHP
  • 2 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 5 Versions
  • 12 % Grown

The README.md

Except-io-nal

The Cloudoki PHP Exception extensions throw manageable errors in a multi-tier MQ alignment., (*1)

The main goal of this package is to correctly bubble exceptions from the worker to the api layer. On the API layer, cases for production and development environments can be implemented., (*2)

Dependencies

None so far., (*3)


Install

  1. Add the cloudoki/except-io-nal package to your composer file (dev-master is fine).
  2. The Classes load as \Cloudoki\SomeException.
  3. Load the custom exception handler in App/Exceptions/Handler.php, like so:
namespace App\Exceptions;

use Cloudoki\Proc\ExceptionalHandler;

class Handler extends ExceptionalHandler {}

Usage

The package defines a set of Exception extensions. They are easy to emplement in any PHP environment, but are especially useful in a MQ alignment (API Worker). The Exceptions assist worker level errors to correctly bubble up in the API response., (*4)

DatabaseException

We use the DatabaseException to define unexpected database responses and time-outs on connections., (*5)

InvalidEnvironmentException

If an interaction is triggered outside the desired environment scope (eg. development or production), an InvalidEnvironment should be thrown to kill the process., (*6)

MissingParameterException

A common exception in API applications. Bubbles a useful error message if set up correctly., (*7)

InvalidParameterException

Probably the most common custom Exception., (*8)

IncompleteModelException

While developing new model scopes, this exception can be useful to flag accidently accessed unfinished logic., (*9)

MissingSchemaException

Schema's are used in the Cloudoki/SchemaModel package. To be released soon., (*10)

QuotaExceededException

Some quota limitation has been exceeded. Used in eg. the Limiter package., (*11)

InvalidUserException

A default authorisation error response., (*12)

WorkerException

The API should define errors bubbled up from the Worker response as a WorkerException for logging purposes., (*13)

Responses

The exceptions are even more useful in a development/production divided environment, where an endpoint consumer has no business with internal problems as eg. a worker-level logic bug. By default, the package returns 3 responses., (*14)

400 Response

Malformed method or request syntax, (*15)

403 Response

No valid authorization provided, (*16)

404 Response

Not Found, (*17)

A 500 response should be avoided in any production situation., (*18)

The Versions

13/10 2016

dev-master

9999999-dev http://github.com/Cloudoki/Except-io-nal

The Cloudoki PHP Exception extensions throw manageable errors in a multi-tier MQ alignment

  Sources   Download

MIT

The Requires

  • php >=5.4.0

 

by Cloudoki

php exceptions mq 3-layer

13/10 2016

v0.5.2

0.5.2.0 http://github.com/Cloudoki/Except-io-nal

The Cloudoki PHP Exception extensions throw manageable errors in a multi-tier MQ alignment

  Sources   Download

MIT

The Requires

  • php >=5.4.0

 

by Cloudoki

php exceptions mq 3-layer

30/01 2016

v0.5.01

0.5.01.0 http://github.com/Cloudoki/Except-io-nal

The Cloudoki PHP Exception extensions throw manageable errors in a multi-tier MQ alignment

  Sources   Download

MIT

The Requires

  • php >=5.4.0

 

by Cloudoki

php exceptions mq 3-layer

25/01 2016

v0.5

0.5.0.0 http://github.com/Cloudoki/Except-io-nal

The Cloudoki PHP Exception extensions throw manageable errors in a multi-tier MQ alignment

  Sources   Download

MIT

The Requires

  • php >=5.4.0

 

by Cloudoki

php exceptions mq 3-layer

25/06 2015

v0.4

0.4.0.0 http://github.com/Cloudoki/Except-io-nal

The Cloudoki PHP Exception extensions throw manageable errors in a MQ alignment

  Sources   Download

MIT

The Requires

  • php >=5.4.0

 

by Cloudoki

php exceptions mq 3-layer