Skip to content

Commit fad4f3a

Browse files
Anton ShevchukAnton Shevchuk
authored andcommitted
Added error handler for bin/bluzman
1 parent 22aa517 commit fad4f3a

1 file changed

Lines changed: 20 additions & 13 deletions

File tree

bin/bluzman

Lines changed: 20 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -35,16 +35,23 @@ ini_set('display_errors', 1);
3535
ini_set('log_errors', 0);
3636
ini_set('html_errors', 0);
3737

38-
// Get project info from composer.json
39-
$composerConfig = json_decode(
40-
file_get_contents(PATH_VENDOR .DS. 'bluzphp' .DS. 'bluzman' .DS. 'composer.json'),
41-
true
42-
);
43-
require_once PATH_VENDOR . '/autoload.php';
44-
45-
$application = new Bluzman\Application\Application(
46-
$composerConfig['description'],
47-
$composerConfig['version'] ?? 'dev'
48-
);
49-
$application->init();
50-
$application->run();
38+
try {
39+
// Get project info from composer.json
40+
$composerConfig = json_decode(
41+
file_get_contents(PATH_VENDOR . DS . 'bluzphp' . DS . 'bluzman' . DS . 'composer.json'),
42+
true
43+
);
44+
require_once PATH_VENDOR . '/autoload.php';
45+
46+
$application = new Bluzman\Application\Application(
47+
$composerConfig['description'],
48+
$composerConfig['version'] ?? 'dev'
49+
);
50+
$application->init();
51+
$application->run();
52+
} catch (\Throwable $e) {
53+
echo "Error #{$e->getCode()}:\n\n";
54+
echo "\t{$e->getFile()}:{$e->getLine()}\n";
55+
echo "\t{$e->getMessage()}\n";
56+
echo "\n";
57+
}

0 commit comments

Comments
 (0)