PHP code example of infira / errorhandler

1. Go to this page and download the library: Download infira/errorhandler library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

infira / errorhandler example snippets


use Infira\Error\Error;

alert("my error",['extra'=>'data']); //it's a helper to Error::trigger
Error::trigger("my error",['extra'=>'data']);

use Infira\Error\Handler;
{
	alert("my error",['extra'=>'data']);
	//OR
	callingNotExistingMethod();
	//OR
	echo $a
}
catch (Throwable $e) {
	echo Handler::compile($e)->getHTMLTable();
}

use Infira\Error\Handler;
{
	makeError
}
catch (Throwable $e) {
    echo "<pre>".print_r(Handler::compile($e)->toArray(); //outputs all data that has been collected
}