2017 © Pedro Peláez
 

library errors

Bootstraps errors and handles them via reporters and renderers

image

lucinda/errors

Bootstraps errors and handles them via reporters and renderers

  • Friday, April 27, 2018
  • by aherne
  • Repository
  • 1 Watchers
  • 0 Stars
  • 328 Installations
  • PHP
  • 1 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 6 Versions
  • 13 % Grown

The README.md

php-errors-api

Like any other scripting language, PHP has two types of errors:, (*1)

  • syntax errors: language errors in your script that cause immediate failure. These errors cause script to exit immediately without going through a listenable shutdown phase. Thankfully though, they are easily dealt with by using a modern IDE (such as Eclipse) that highlights syntax errors.
  • execution errors: errors that appear while a correctly written script is executed. PHP recognizes following types of execution errors:
    • fatal errors: self-handled errors causing script to exit, while a message is displayed and a log entry is recorded (eg: a non-existent method is called)
    • non-fatal errors: self-handled errors causing script to continue execution, while a message is displayed and a log entry is recorded (eg: a non-existent entry in an array is accessed)
    • exceptions: user-handled errors that can be manually thrown and handled

Ideally, errors should have thrown an exception able to be user-handled (to make the the whole process of error handling controllable from a single point), but up until version 7.0 users had to manually direct self-handled errors & uncaught exceptions to user-defined exceptions in order to achieve a single point of control for errors flow. This functionality, primitive as it is, provides a hook for an AOP layer that non-destructively listens to application for cross-cutting concerns (errors), keeping all other components strictly dedicated to their purpose and oblivious of error handling., (*2)

ErrorsAPI provides a thin layer of abstraction (skeleton) for unified error handling (redirecting all uncaught error to an errors' front controller). Its control point is the ErrorHandler class, able to register reporters (storage mediums in which error will be logged into) and renderer (entity that will perform response back to caller), then handle any exception by delegating to registered reporters and renderer. In order to handle PHP execution errors as well, API turns on reporting for all PHP errors then redirects them to a PHPException class, via native set_error_handler & register_shutdown_function. From that moment on, every PHP execution error will automatically throw a PHPException, which is then delegated to an ErrorHandler instance that must be registered beforehand., (*3)

More information here:br/ http://www.lucinda-framework.com/errors-api, (*4)

The Versions

27/04 2018

dev-master

9999999-dev http://www.lucinda-framework.com/errors-api

Bootstraps errors and handles them via reporters and renderers

  Sources   Download

MIT

by Lucian Popescu

errors renderer handler aop reporter aspect oriented programming

27/04 2018

v1.2.2

1.2.2.0 http://www.lucinda-framework.com/errors-api

Bootstraps errors and handles them via reporters and renderers

  Sources   Download

MIT

by Lucian Popescu

errors renderer handler aop reporter aspect oriented programming

03/03 2018

v1.2.1

1.2.1.0 http://www.lucinda-framework.com/errors-api

Bootstraps errors and handles them via reporters and renderers

  Sources   Download

MIT

by Lucian Popescu

errors renderer handler aop reporter aspect oriented programming

02/02 2018

v1.2.0

1.2.0.0 http://www.lucinda-framework.com/errors-api

Bootstraps errors and handles them via reporters and renderers

  Sources   Download

MIT

by Lucian Popescu

errors renderer handler aop reporter aspect oriented programming

27/01 2018

v1.1.0

1.1.0.0 http://www.lucinda-framework.com/errors-api

Bootstraps errors and handles them via reporters and renderers

  Sources   Download

MIT

by Lucian Popescu

errors renderer handler aop reporter aspect oriented programming

07/11 2017

v1.0.0

1.0.0.0 http://www.lucinda-framework.com/errors-api

Bootstraps errors and handles them via reporters and renderers

  Sources   Download

MIT

by Lucian Popescu

errors renderer handler aop reporter aspect oriented programming