2017 © Pedro Peláez
 

library exceptions

Catch fatal errors and warnings that would otherwise be difficult to handle

image

spencer-mortensen/exceptions

Catch fatal errors and warnings that would otherwise be difficult to handle

  • Thursday, June 28, 2018
  • by spencermortensen
  • Repository
  • 1 Watchers
  • 0 Stars
  • 85 Installations
  • PHP
  • 2 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 12 Versions
  • 118 % Grown

The README.md

Exceptions

This project is available as a Composer Package:
spencer-mortensen/exceptions, (*1)

Overview

Error handling in PHP is complicated, but this library makes it bullet-proof: Create a method to handle exceptions (e.g. $handler->handle($throwable);) and you're good to go!, (*2)

This library converts all PHP notices, warnings, and errors into exceptions, so you can handle them. It also works on any thrown exceptions that make it up to the global scope. It even catches most of the fatal errors, which would otherwise be impossible to handle., (*3)

Usage

Example 1. Enable error handling for the entire program:, (*4)

new ErrorHandling($errorHandler, E_ALL);

Example 2. Enable error handling ONLY for your portion of the code:, (*5)

try {
    ErrorHandling::on();
    ...
} finally {
    ErrorHandling::off();
}

This converts PHP notices, warnings, and errors into catchable exceptions, but only for the duration of the try/catch block., (*6)

Example 3. Show the built-in PHP STDERR messages, so you can see errors while you're working on your error handler. If you're working on your error handler, and you're getting a blank screen, use this:, (*7)

new ErrorHandling($errorHandler, E_ALL, false);

When you're finished, set everything back to normal:, (*8)

new ErrorHandling($errorHandler, E_ALL);

See the example area for working code and ideas., (*9)

The Versions

28/06 2018

dev-master

9999999-dev https://github.com/spencer-mortensen/exceptions

Catch fatal errors and warnings that would otherwise be difficult to handle

  Sources   Download

LGPL-3.0-or-later

The Requires

 

exceptions

28/06 2018

3.2.2

3.2.2.0 https://github.com/spencer-mortensen/exceptions

Catch fatal errors and warnings that would otherwise be difficult to handle

  Sources   Download

LGPL-3.0-or-later

The Requires

 

exceptions

28/06 2018

3.2.1

3.2.1.0 https://github.com/spencer-mortensen/exceptions

Catch fatal errors and warnings that would otherwise be difficult to handle

  Sources   Download

LGPL-3.0-or-later

The Requires

 

exceptions

28/06 2018

3.2.0

3.2.0.0 https://github.com/spencer-mortensen/exceptions

Catch fatal errors and warnings that would otherwise be difficult to handle

  Sources   Download

LGPL-3.0-or-later

The Requires

 

exceptions

28/06 2018

3.1.0

3.1.0.0 https://github.com/spencer-mortensen/exceptions

Catch fatal errors and warnings that would otherwise be difficult to handle

  Sources   Download

LGPL-3.0-or-later

The Requires

 

exceptions

27/06 2018

3.0.2

3.0.2.0 https://github.com/spencer-mortensen/exceptions

Catch fatal errors and warnings that would otherwise be difficult to handle

  Sources   Download

LGPL-3.0-or-later

The Requires

 

exceptions

27/06 2018

3.0.1

3.0.1.0 https://github.com/spencer-mortensen/exceptions

Catch fatal errors and warnings that would otherwise be difficult to handle

  Sources   Download

LGPL-3.0-or-later

The Requires

 

exceptions

27/06 2018

3.0.0

3.0.0.0 https://github.com/spencer-mortensen/exceptions

Catch fatal errors and warnings that would otherwise be difficult to handle

  Sources   Download

LGPL-3.0-or-later

The Requires

 

exceptions

28/01 2018

2.0.2

2.0.2.0 https://github.com/spencer-mortensen/exceptions

Catch fatal errors and warnings that would otherwise be difficult to handle

  Sources   Download

LGPL-3.0-or-later

The Requires

  • php >=5.3.0

 

exceptions

11/01 2018

2.0.1

2.0.1.0 https://github.com/spencer-mortensen/exceptions

Catch fatal errors and warnings that would otherwise be difficult to handle

  Sources   Download

LGPL-3.0

The Requires

  • php >=5.3.0

 

exceptions

05/01 2018

2.0.0

2.0.0.0 https://github.com/spencer-mortensen/exceptions

Convert built-in PHP errors into thrown exceptions

  Sources   Download

LGPL-3.0

The Requires

  • php >=5.3.0

 

exceptions

01/01 2018

1.0.0

1.0.0.0 https://github.com/spencer-mortensen/exceptions

Convert built-in PHP errors into thrown exceptions

  Sources   Download

LGPL-3.0

The Requires

  • php >=5.3.0

 

exceptions