From abc6230834104cf92ce54d8377e46524fa6ed63e Mon Sep 17 00:00:00 2001 From: John Cardinal Date: Fri, 23 Sep 2022 20:13:51 +0000 Subject: [PATCH] --- source/Plugins/AyaNova.Plugin.V8/V8.cs | 54 +++++++++++++++++++++----- 1 file changed, 45 insertions(+), 9 deletions(-) diff --git a/source/Plugins/AyaNova.Plugin.V8/V8.cs b/source/Plugins/AyaNova.Plugin.V8/V8.cs index 3aa6c00..8ed6a84 100644 --- a/source/Plugins/AyaNova.Plugin.V8/V8.cs +++ b/source/Plugins/AyaNova.Plugin.V8/V8.cs @@ -166,7 +166,7 @@ namespace AyaNova.PlugIn.V8 //here because we logged in fine and can proceed if (MessageBox.Show("Warning: if you continue the AyaNova 8 destination server's database will be erased.\r\nAre you sure you want to continue?", "Erase data warning", MessageBoxButtons.YesNo, MessageBoxIcon.Question) != DialogResult.Yes) return; if (MessageBox.Show("Last chance: the next step will start migration and the AyaNova 8 target server's data will be erased.\r\nAre you sure you want to proceed?", "Continue migration", MessageBoxButtons.YesNo, MessageBoxIcon.Question) != DialogResult.Yes) return; - + //Only one command DoExport(); } @@ -570,9 +570,7 @@ namespace AyaNova.PlugIn.V8 End: ; - //MIGRATE MODE - progress.Append("Setting v8 Server State to 'Open'"); - await util.PostAsync("server-state", "{\"serverState\":\"Open\"}"); + } catch (Exception ex) @@ -596,17 +594,55 @@ namespace AyaNova.PlugIn.V8 progress.Append(ExceptionDuringMigrate.InnerException.StackTrace); } } + progress.FinishedImport();//just enables close / cancel etc - progress.Op("Saving export log to v8 memo for SuperUser..."); - await PostExportLogToV8(progress); - - progress.Append("Log and help links saved in v8 Memo to SuperUser account (Home->Memos)"); + try//LOG TO MEMO SUPERUSER + { + //this might fail due to any number of various error conditions or prior + //issues so attempt it but don't let it get in the way of completion + progress.Op("Saving export log to v8 memo for SuperUser..."); + await PostExportLogToV8(progress); + progress.Append("Log and help links saved in v8 Memo to SuperUser account (Home->Memos)"); + } + catch (Exception exFailedMemoLog) + { + progress.Append("ERROR creating export log Memo for SuperUser:"); + progress.Append(exFailedMemoLog.Message); + if (exFailedMemoLog.InnerException != null) + { + progress.Append("Inner error:"); + progress.Append(exFailedMemoLog.InnerException.Message); + progress.Append("Inner StackTrace:"); + progress.Append(exFailedMemoLog.InnerException.StackTrace); + } + } + try//to re-open server regardless of what transpired before + { + //MIGRATE MODE + progress.Append("Setting v8 Server State to 'Open'"); + await util.PostAsync("server-state", "{\"serverState\":\"Open\"}"); + } + catch (Exception exFailedToReopen) + { + progress.Append("ERROR setting v8 server state to 'Open':"); + progress.Append(exFailedToReopen.Message); + if (exFailedToReopen.InnerException != null) + { + progress.Append("Inner error:"); + progress.Append(exFailedToReopen.InnerException.Message); + progress.Append("Inner StackTrace:"); + progress.Append(exFailedToReopen.InnerException.StackTrace); + } + } progress.Append("###################################"); progress.Append("###################################"); - progress.Append("Export completed"); + if (ExceptionDuringMigrate != null) + progress.Append("Export completed"); + else + progress.Append("Export ** FAILED **"); progress.Op(""); progress.SubOp("");