Commit 9aa0bf2b authored by Helmo's avatar Helmo Committed by Kristián Feldsam
Browse files

Try to catch soap errors

parent d46121b3
......@@ -426,7 +426,13 @@ class page_action extends tform_actions {
'client_group_id' => $client_group_id,
);
$site_id = $remote->insert_query('../sites/form/web_vhost_domain.tform.php', $fields['client_id'], $params, 'sites:web_vhost_domain:on_after_insert');
try {
$site_id = $remote->insert_query('../sites/form/web_vhost_domain.tform.php', $fields['client_id'], $params, 'sites:web_vhost_domain:on_after_insert');
} catch (SoapFault $e) {
$app->tform->errorMessage = $e->getMessage();
$this->onError();
return;
}
// get site data
$app->uses('remoting_lib');
......@@ -457,7 +463,13 @@ class page_action extends tform_actions {
'database_user_prefix' => $client_db_prefix,
'database_password' => $app->auth->get_random_password($min_password_length, true),
);
$db_user_id = $remote->insert_query('../sites/form/database_user.tform.php', $fields['client_id'], $db_user_params, 'sites:web_database_user:on_after_insert');
try {
$db_user_id = $remote->insert_query('../sites/form/database_user.tform.php', $fields['client_id'], $db_user_params, 'sites:web_database_user:on_after_insert');
} catch (SoapFault $e) {
$app->tform->errorMessage = $e->getMessage();
$this->onError();
return;
}
// add database
$params = array(
......@@ -473,7 +485,13 @@ class page_action extends tform_actions {
'remote_ips' => $template['database_remote_ips'],
'active' => 'y'
);
$remote->sites_database_add($fields['client_id'], $params);
try {
$remote->sites_database_add($fields['client_id'], $params);
} catch (SoapFault $e) {
$app->tform->errorMessage = $e->getMessage();
$this->onError();
return;
}
}
if($fields['ftp']) {
......@@ -496,7 +514,13 @@ class page_action extends tform_actions {
'dl_bandwidth' => $template['dl_bandwidth'],
'active' => 'y',
);
$remote->insert_query('../sites/form/ftp_user.tform.php', $fields['client_id'], $ftp_params);
try {
$remote->insert_query('../sites/form/ftp_user.tform.php', $fields['client_id'], $ftp_params);
} catch (SoapFault $e) {
$app->tform->errorMessage = $e->getMessage();
$this->onError();
return;
}
}
if($fields['ssh']) {
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment