From 406a790cf5a966d724a81a3b57afd89d5b9eef99 Mon Sep 17 00:00:00 2001 From: Jorik Schellekens Date: Tue, 27 Aug 2019 16:52:25 +0100 Subject: Handle errors when synapse fails to start. --- synapse_topology/webui/src/js/actions/index.js | 22 +++++++++++++++++++++- synapse_topology/webui/src/js/actions/types.js | 3 ++- 2 files changed, 23 insertions(+), 2 deletions(-) (limited to 'synapse_topology/webui') diff --git a/synapse_topology/webui/src/js/actions/index.js b/synapse_topology/webui/src/js/actions/index.js index 7aa04ff212..8b8033d1f5 100644 --- a/synapse_topology/webui/src/js/actions/index.js +++ b/synapse_topology/webui/src/js/actions/index.js @@ -287,12 +287,32 @@ export const writeConfig = (config, subConfigName) => { return (dispatch, getState) => { postConfig(baseConfigToSynapseConfig(getState().baseConfig), subConfigName) - .then(res => startSynapse(), error => dispatch(fail(error))) + .then( + res => startSynapse().then( + res => dispatch(advanceUI()), + error => { + + fail(error); + dispatch(synapseStartFailed()); + + } + ), + error => { + + dispatch(fail(error)); + dispatch(synapseStartStartFailed()) + + } + ) } } +export const synapseStartFailed = () => ({ + type: SYNAPSE_START_FAILED, +}) + export const resetUI = (ui) => ({ type: BACK_UI, ui, diff --git a/synapse_topology/webui/src/js/actions/types.js b/synapse_topology/webui/src/js/actions/types.js index 24d3f23cc1..2b4245e8dc 100644 --- a/synapse_topology/webui/src/js/actions/types.js +++ b/synapse_topology/webui/src/js/actions/types.js @@ -21,4 +21,5 @@ export const SET_SYNAPSE_PORTS = 'SET_SYNAPSE_PORTS'; export const SET_SYNAPSE_PORTS_FREE = 'SET_SYNAPSE_PORTS_IN_USE'; export const SET_DATABASE = 'SET_DATABASE'; export const SET_CONFIG_DIR = 'SET_CONFIG_DIR'; -export const WRITE_CONFIG = 'WRITE_CONFIG'; \ No newline at end of file +export const WRITE_CONFIG = 'WRITE_CONFIG'; +export const SYNAPSE_START = 'SYNAPSE_START'; \ No newline at end of file -- cgit 1.5.1