Update some modules to throw exceptions instead of BaseObject

This commit is contained in:
Kijin Sung 2018-08-27 00:03:12 +09:00
parent f6fa7493f6
commit 1863edcbb8
12 changed files with 118 additions and 118 deletions

View file

@ -20,7 +20,7 @@ class installAdminController extends install
function procInstallAdminInstall()
{
$module_name = Context::get('module_name');
if(!$module_name) return $this->setError('invalid_request');
if(!$module_name) throw new Rhymix\Framework\Exception('invalid_request');
$oInstallController = getController('install');
$oInstallController->installModule($module_name, './modules/'.$module_name);
@ -35,10 +35,10 @@ class installAdminController extends install
{
@set_time_limit(0);
$module_name = Context::get('module_name');
if(!$module_name) return $this->setError('invalid_request');
if(!$module_name) throw new Rhymix\Framework\Exception('invalid_request');
$oModule = getModule($module_name, 'class');
if(!$oModule) return $this->setError('invalid_request');
if(!$oModule) throw new Rhymix\Framework\Exception('invalid_request');
$output = $oModule->moduleUpdate();
if($output instanceof BaseObject && !$output->toBool())

View file

@ -76,7 +76,7 @@ class installController extends install
{
if ($oDB->isTableExists($table_name))
{
return $this->setError('msg_table_already_exists');
throw new Rhymix\Framework\Exception('msg_table_already_exists');
}
}
@ -99,7 +99,7 @@ class installController extends install
// Check if it is already installed
if (Context::isInstalled())
{
return $this->setError('msg_already_installed');
throw new Rhymix\Framework\Exception('msg_already_installed');
}
// Get install parameters.
@ -227,7 +227,7 @@ class installController extends install
catch(Exception $e)
{
$oDB->rollback();
return $this->setError($e->getMessage());
throw new Rhymix\Framework\Exception($e->getMessage());
}
// Execute the install script.
@ -411,7 +411,7 @@ class installController extends install
else
{
FileHandler::removeFile($this->flagLicenseAgreement);
return $this->setError('msg_must_accept_license_agreement');
throw new Rhymix\Framework\Exception('msg_must_accept_license_agreement');
}
if(!in_array(Context::getRequestMethod(),array('XMLRPC','JSON')))