Error Handler Library

Introduction:

Unlike other languages like Java, in PHP "Exceptions" are handled in a different way than "Errors". In PHP, any anomaly in the logic such as "Divide by zero" are considered as errors and things such as "Trying to access a private property" is considered as "Exceptions". "Exceptions" are thrown in PHP like any other language, but "Errors" are not thrown and they need to be converted to "Exceptions" and thrown accordingly by the programmer. This introduces many confusion among developers as they are accustomed to treat everything as an "Exception" and expect them to be thrown automatically. 

Need for this Library: PHP has a mechanism that allows the developers to set functions that they can register in case any error is generated. This function, once registered, is called whenever an error is generated and then it will be converted to an "Exception" and then will be thrown. In this library we take this task to register the function and to convert them to an "Exception" from the developers and do it ourselves so that they do not have to worry about this. This library first registers the function that converts "Errors" to "Exceptions" so that PHP can call this function and handle it properly in case any "Error" is generated. This function also has the job to convert the PHP "Error" to "Exception". The name of the exception that is produced after the conversion is "ErrorException".