summary refs log tree commit diff
path: root/synapse_topology/webui
diff options
context:
space:
mode:
authorJorik Schellekens <joriks@matrix.org>2019-08-27 16:52:25 +0100
committerJorik Schellekens <joriks@matrix.org>2019-08-28 15:59:54 +0100
commit406a790cf5a966d724a81a3b57afd89d5b9eef99 (patch)
treec768d4462b658423aad7526a9a600de750bc6f78 /synapse_topology/webui
parentServer throws errors on synctl error (diff)
downloadsynapse-406a790cf5a966d724a81a3b57afd89d5b9eef99.tar.xz
Handle errors when synapse fails to start.
Diffstat (limited to 'synapse_topology/webui')
-rw-r--r--synapse_topology/webui/src/js/actions/index.js22
-rw-r--r--synapse_topology/webui/src/js/actions/types.js3
2 files changed, 23 insertions, 2 deletions
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