mirror of
https://github.com/PepperDash/Essentials.git
synced 2026-04-19 23:46:49 +00:00
feat: Enhance initialization error handling and add console command for reporting exceptions
This commit is contained in:
parent
71cf7ef4df
commit
5f4a35d425
1 changed files with 86 additions and 76 deletions
|
|
@ -126,6 +126,8 @@ public class ControlSystem : CrestronControlSystem, ILoadConfig, IInitialization
|
|||
}
|
||||
|
||||
private void StartSystem(object preventInitialization)
|
||||
{
|
||||
try
|
||||
{
|
||||
DeterminePlatform();
|
||||
|
||||
|
|
@ -192,7 +194,7 @@ public class ControlSystem : CrestronControlSystem, ILoadConfig, IInitialization
|
|||
"getroutingports", "Reports all routing ports, if any. Requires a device key", ConsoleAccessLevelEnum.AccessOperator);
|
||||
|
||||
CrestronConsole.AddNewConsoleCommand(PrintInitializationExceptions,
|
||||
"getinitializationexceptions", "Reports any exceptions that occurred during initialization", ConsoleAccessLevelEnum.AccessOperator);
|
||||
"getinitexceptions", "Reports any exceptions that occurred during initialization", ConsoleAccessLevelEnum.AccessOperator);
|
||||
|
||||
DeviceManager.AddDevice(new EssentialsWebApi("essentialsWebApi", "Essentials Web API"));
|
||||
|
||||
|
|
@ -207,6 +209,12 @@ public class ControlSystem : CrestronControlSystem, ILoadConfig, IInitialization
|
|||
SystemMonitor.ProgramInitialization.ProgramInitializationComplete = true;
|
||||
}
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
InitializationExceptions.Add(e);
|
||||
Debug.LogFatal(e, "FATAL INITIALIZE ERROR. System is in an inconsistent state");
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Determines if the program is running on a processor (appliance) or server (VC-4).
|
||||
|
|
@ -277,6 +285,7 @@ public class ControlSystem : CrestronControlSystem, ILoadConfig, IInitialization
|
|||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
InitializationExceptions.Add(e);
|
||||
Debug.LogMessage(e, "Unable to determine platform due to exception");
|
||||
}
|
||||
}
|
||||
|
|
@ -331,7 +340,8 @@ public class ControlSystem : CrestronControlSystem, ILoadConfig, IInitialization
|
|||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
Debug.LogMessage(e, "FATAL INITIALIZE ERROR. System is in an inconsistent state");
|
||||
InitializationExceptions.Add(e);
|
||||
Debug.LogFatal(e, "FATAL INITIALIZE ERROR. System is in an inconsistent state");
|
||||
}
|
||||
finally
|
||||
{
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue