diff --git a/app/modules/config/add.py b/app/modules/config/add.py index e51d9f8..dfae4e8 100644 --- a/app/modules/config/add.py +++ b/app/modules/config/add.py @@ -216,7 +216,10 @@ def save_bwlist(list_name: str, list_con: str, color: str, group: str, server_ip for serv in servers: server_mod.ssh_command(serv, [f"sudo mkdir {path}"]) server_mod.ssh_command(serv, [f"sudo chown $(whoami) {path}"]) - error = config_mod.upload(serv, f'{path}/{list_name}', list_path) + try: + error = config_mod.upload(serv, f'{path}/{list_name}', list_path) + except Exception as e: + error = f'{serv}: {e}' if error: output += f'error: Upload fail: {error} , ' diff --git a/app/modules/config/config.py b/app/modules/config/config.py index 02ce2be..fbb0a80 100644 --- a/app/modules/config/config.py +++ b/app/modules/config/config.py @@ -53,8 +53,7 @@ def upload(server_ip, path, file): except Exception as e: error = str(e.args) roxywi_common.logging('Roxy-WI server', f'error: Cannot upload {file} to {path} to server: {server_ip}: {error}', roxywi=1) - print(f'error: Cannot upload {file} to {path} to server: {server_ip}: {error}') - raise Exception(error) + raise Exception(f'error: Cannot upload {file} to {path} to server: {server_ip}: {error}') def upload_and_restart(server_ip: str, cfg: str, just_save: str, service: str, **kwargs):