iroegbu / ErrorExceptions

A library for converting core PHP errors into ErrorExceptions

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

ErrorExceptions

A library for converting core PHP errors into ErrorExceptions

Installation

Clone the latest iteration from github

$ git clone https://github.com/iroegbu/ErrorExceptions.git

Then require

require_once 'lib/ErrorExceptions/ErrorExceptions.php';

Usage

try {
    fopen('bar.baz.biz', 'r');
} catch (FileNotFoundException $e) {
    // "Warning: No such file or directory in..." becomes an instance of FileNotFoundException
    var_dump(get_class($e));
}

About

A library for converting core PHP errors into ErrorExceptions


Languages

Language:PHP 100.0%