PHP code example of mggflow / exception-manager
1. Go to this page and download the library: Download mggflow/exception-manager 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/ */
mggflow / exception-manager example snippets
try {
throw ManageException::build()
->log()->warning()->b()
->desc()->internal()->tooMany(null, 'Requests')
->context(uniqid(), 'importantID')->b()
->fill();
} catch (UniException $uniException) {
echo '<pre>';
var_dump($uniException->getCode());
var_dump($uniException->getMessage());
var_dump($uniException->getInternalMessage());
var_dump($uniException->getLogLvl());
var_dump($uniException->getContext());
var_dump($uniException->getMessageParts());
echo '</pre>';
}
int(13)
string(14) "Internal Error"
string(17) "Too many Requests"
int(32)
array(1) {
["importantID"]=>
string(13) "64050ff0be4fa"
}
array(1) {
[0]=>
array(2) {
[0]=>
int(13)
[1]=>
array(2) {
[0]=>
string(8) "too many"
[1]=>
string(8) "Requests"
}
}
}