Add popup for exception on worker thread.
This commit is contained in:
@@ -191,9 +191,10 @@ namespace Cryville.Crtr {
|
|||||||
Logger.Log("main", 1, "Load/MainThread", "Main thread done ({0}ms)", texloadtimer.Elapsed.TotalMilliseconds);
|
Logger.Log("main", 1, "Load/MainThread", "Main thread done ({0}ms)", texloadtimer.Elapsed.TotalMilliseconds);
|
||||||
}
|
}
|
||||||
if (!loadThread.IsAlive) {
|
if (!loadThread.IsAlive) {
|
||||||
if (cbus == null) {
|
if (threadException != null) {
|
||||||
Logger.Log("main", 4, "Load/MainThread", "Load failed");
|
Logger.Log("main", 4, "Load/MainThread", "Load failed");
|
||||||
loadThread = null;
|
loadThread = null;
|
||||||
|
Popup.CreateException(threadException);
|
||||||
#if BUILD
|
#if BUILD
|
||||||
ReturnToMenu();
|
ReturnToMenu();
|
||||||
#endif
|
#endif
|
||||||
@@ -447,6 +448,7 @@ namespace Cryville.Crtr {
|
|||||||
public FileInfo skinFile;
|
public FileInfo skinFile;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Exception threadException;
|
||||||
#if !NO_THREAD
|
#if !NO_THREAD
|
||||||
Thread loadThread = null;
|
Thread loadThread = null;
|
||||||
diag::Stopwatch workerTimer;
|
diag::Stopwatch workerTimer;
|
||||||
@@ -463,6 +465,7 @@ namespace Cryville.Crtr {
|
|||||||
}
|
}
|
||||||
catch (Exception ex) {
|
catch (Exception ex) {
|
||||||
Game.LogException("Load/WorkerThread", "An error occured while loading the data", ex);
|
Game.LogException("Load/WorkerThread", "An error occured while loading the data", ex);
|
||||||
|
threadException = ex;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user