mirror of
https://github.com/slawkens/myaac.git
synced 2025-10-14 01:34:55 +02:00
RuntimeException instead of die()
This commit is contained in:
@@ -903,7 +903,7 @@ function load_config_lua($filename)
|
||||
if(!@file_exists($config_file))
|
||||
{
|
||||
log_append('error.log', '[load_config_file] Fatal error: Cannot load config.lua (' . $filename . '). Error: ' . print_r(error_get_last(), true));
|
||||
die('ERROR: Cannot find ' . $filename . ' file. More info in system/logs/error.log');
|
||||
throw new RuntimeException('ERROR: Cannot find ' . $filename . ' file. More info in system/logs/error.log');
|
||||
}
|
||||
|
||||
$result = array();
|
||||
@@ -949,7 +949,7 @@ function load_config_lua($filename)
|
||||
$ret = @eval("return $value;");
|
||||
if((string) $ret == '') // = parser error
|
||||
{
|
||||
die('ERROR: Loading config.lua file. Line <b>' . ($ln + 1) . '</b> of LUA config file is not valid [key: <b>' . $key . '</b>]');
|
||||
throw new RuntimeException('ERROR: Loading config.lua file. Line <b>' . ($ln + 1) . '</b> of LUA config file is not valid [key: <b>' . $key . '</b>]');
|
||||
}
|
||||
$result[$key] = $ret;
|
||||
}
|
||||
|
@@ -15,7 +15,7 @@ if(file_exists(BASE . 'config.local.php')) // user customizations
|
||||
require BASE . 'config.local.php';
|
||||
|
||||
if(!isset($config['installed']) || !$config['installed']) {
|
||||
die('MyAAC has not been installed yet or there was error during installation. Please install again.');
|
||||
throw new RuntimeException('MyAAC has not been installed yet or there was error during installation. Please install again.');
|
||||
}
|
||||
|
||||
date_default_timezone_set($config['date_timezone']);
|
||||
@@ -139,7 +139,7 @@ else {
|
||||
$vocations->load($file);
|
||||
|
||||
if(!$vocations)
|
||||
die('ERROR: Cannot load <i>vocations.xml</i> file.');
|
||||
throw new RuntimeException('ERROR: Cannot load <i>vocations.xml</i> file.');
|
||||
|
||||
$config['vocations'] = array();
|
||||
foreach($vocations->getElementsByTagName('vocation') as $vocation) {
|
||||
|
@@ -24,7 +24,7 @@ function generateItem($id = 100, $count = 1) {
|
||||
function itemImageExists($id, $count = 1)
|
||||
{
|
||||
if(!isset($id))
|
||||
die('ERROR - itemImageExists: id has been not set!');
|
||||
throw new RuntimeException('ERROR - itemImageExists: id has been not set!');
|
||||
|
||||
$file_name = $id;
|
||||
if($count > 1)
|
||||
|
@@ -241,7 +241,7 @@ class Items_Images
|
||||
self::$spr = fopen(self::$files['spr'], 'rb');
|
||||
|
||||
if(!self::$otb || !self::$dat || !self::$spr)
|
||||
die('ERROR: Cannot load data files.');
|
||||
throw new RuntimeException('ERROR: Cannot load data files.');
|
||||
/*
|
||||
if ( $nostand )
|
||||
{
|
||||
|
@@ -57,8 +57,7 @@ if(isset($last_threads[0]))
|
||||
|
||||
$player->load($thread['player_id']);
|
||||
if(!$player->isLoaded()) {
|
||||
error('Forum error: Player not loaded.');
|
||||
die();
|
||||
throw new RuntimeException('Forum error: Player not loaded.');
|
||||
}
|
||||
|
||||
$player_account = $player->getAccount();
|
||||
|
@@ -46,8 +46,7 @@ foreach($posts as &$post)
|
||||
$player = $post['player'];
|
||||
$player->load($post['player_id']);
|
||||
if(!$player->isLoaded()) {
|
||||
error('Forum error: Player not loaded.');
|
||||
die();
|
||||
throw new RuntimeException('Forum error: Player not loaded.');
|
||||
}
|
||||
|
||||
if($config['characters']['outfit']) {
|
||||
|
Reference in New Issue
Block a user