Index: cloudsync/common/enums.py =================================================================== diff -u -r34a18ebe349364c4e0462d876d4d191bf3df8939 -rcb3e00ce874f5c9e0d01f76701542dcd8752c221 --- cloudsync/common/enums.py (.../enums.py) (revision 34a18ebe349364c4e0462d876d4d191bf3df8939) +++ cloudsync/common/enums.py (.../enums.py) (revision cb3e00ce874f5c9e0d01f76701542dcd8752c221) @@ -131,3 +131,4 @@ CS_SAVE_CONFIG_ERROR = 929 CS_DEVICE_LOG_ERROR = 930 CS_LOG_ERROR = 931 + CS_FACTORY_RESET_ERROR = 932 Index: cloudsync/handlers/cs_mft_dcs_request_handler.py =================================================================== diff -u -r34a18ebe349364c4e0462d876d4d191bf3df8939 -rcb3e00ce874f5c9e0d01f76701542dcd8752c221 --- cloudsync/handlers/cs_mft_dcs_request_handler.py (.../cs_mft_dcs_request_handler.py) (revision 34a18ebe349364c4e0462d876d4d191bf3df8939) +++ cloudsync/handlers/cs_mft_dcs_request_handler.py (.../cs_mft_dcs_request_handler.py) (revision cb3e00ce874f5c9e0d01f76701542dcd8752c221) @@ -121,11 +121,18 @@ e)) self.error_handler.enqueue_error(error=error) elif req.request_type == NetworkRequestType.MFT2CS_REQ_FACTORY_RESET: - req.g_config[CONFIG_DEVICE][CONFIG_DEVICE_MODE] = 'operation' - helpers_write_config(None, CONFIG_PATH, req.g_config) - helpers_write_config(OPERATION_CONFIG_PATH, OPERATION_CONFIG_FILE_PATH, req.g_config) - cmd_incoming_factory_reset(output_channel=self.output_channel) + try: + req.g_config[CONFIG_DEVICE][CONFIG_DEVICE_MODE] = 'operation' + helpers_write_config(None, CONFIG_PATH, req.g_config) + helpers_write_config(OPERATION_CONFIG_PATH, OPERATION_CONFIG_FILE_PATH, req.g_config) + cmd_incoming_factory_reset(output_channel=self.output_channel) + except Exception as e: + error = Error(ERROR_STRING.format(OutboundMessageIDs.CS2UI_ERROR.value, ErrorIDs.CS_FACTORY_RESET_ERROR.value, e)) + self.error_handler.enqueue_error(error=error) + req.g_config[CONFIG_DEVICE][CONFIG_DEVICE_MODE] = 'registration' + helpers_write_config(None, CONFIG_PATH, req.g_config) + # OPERATION MODE elif req.request_type == NetworkRequestType.CS2DCS_REQ_SET_DEVICE_STATE: try: