mirror of
https://github.com/openziti/desktop-edge-win.git
synced 2026-10-14 00:29:48 +00:00
test and try/catch when mime type is not known
This commit is contained in:
@@ -300,13 +300,20 @@ namespace ZitiDesktopEdge
|
||||
var closeMethod = mailWriter.GetType().GetMethod("Close", BindingFlags.Instance | BindingFlags.NonPublic);
|
||||
closeMethod.Invoke(mailWriter, BindingFlags.Instance | BindingFlags.NonPublic, null, new object[] { }, null);
|
||||
}
|
||||
|
||||
var p = Process.Start(emlFile);
|
||||
p.Exited += (object lambdaSender, EventArgs lambdaEventArgs) => {
|
||||
logger.Info("Removing temp file: {0}", emlFile);
|
||||
File.Delete(emlFile);
|
||||
};
|
||||
p.EnableRaisingEvents = true;
|
||||
try {
|
||||
var p = Process.Start(emlFile);
|
||||
if (p != null) {
|
||||
p.Exited += (object lambdaSender, EventArgs lambdaEventArgs) => {
|
||||
logger.Info("Removing temp file: {0}", emlFile);
|
||||
File.Delete(emlFile);
|
||||
};
|
||||
p.EnableRaisingEvents = true;
|
||||
} else {
|
||||
logger.Debug("process was null. most likely the email file format was not known when the process tried to start");
|
||||
}
|
||||
} catch(Exception ex) {
|
||||
logger.Warn(ex, "An unexpected error has occurred when submitting feedback? {0}", ex.Message);
|
||||
}
|
||||
}
|
||||
|
||||
private void ShowSupport(object sender, MouseButtonEventArgs e) {
|
||||
|
||||
@@ -40,6 +40,8 @@ namespace ZitiDesktopEdge {
|
||||
|
||||
private static SemaphoreSlim semaphoreSlim = new SemaphoreSlim(1, 1);
|
||||
|
||||
static System.Reflection.Assembly asm = System.Reflection.Assembly.GetExecutingAssembly();
|
||||
|
||||
public static string ThisAssemblyName;
|
||||
public static string ExecutionDirectory;
|
||||
public static string ExpectedLogPathRoot;
|
||||
@@ -47,7 +49,7 @@ namespace ZitiDesktopEdge {
|
||||
public static string ExpectedLogPathServices;
|
||||
|
||||
static MainWindow() {
|
||||
var asm = System.Reflection.Assembly.GetExecutingAssembly();
|
||||
asm = System.Reflection.Assembly.GetExecutingAssembly();
|
||||
ThisAssemblyName = asm.GetName().Name;
|
||||
#if DEBUG
|
||||
ExecutionDirectory = @"C:\Program Files (x86)\NetFoundry, Inc\Ziti Desktop Edge";
|
||||
|
||||
Reference in New Issue
Block a user