fix: add more exception handling

Also add null check for `AddRouteDescriptor` method
This commit is contained in:
Andrew Welker
2025-02-18 14:00:53 -06:00
parent 5516ed16c3
commit 30d5e2b081
2 changed files with 24 additions and 18 deletions

View File

@@ -107,6 +107,8 @@ namespace PepperDash.Essentials.Core
} }
private static void RunRouteRequest(RouteRequest request) private static void RunRouteRequest(RouteRequest request)
{
try
{ {
if (request.Source == null) if (request.Source == null)
return; return;
@@ -127,6 +129,10 @@ namespace PepperDash.Essentials.Core
audioOrSingleRoute.ExecuteRoutes(); audioOrSingleRoute.ExecuteRoutes();
videoRoute?.ExecuteRoutes(); videoRoute?.ExecuteRoutes();
} catch(Exception ex)
{
Debug.LogMessage(ex,"Exception Running Route Request", null, )
}
} }
public static void ReleaseRoute(this IRoutingInputs destination) public static void ReleaseRoute(this IRoutingInputs destination)

View File

@@ -41,7 +41,7 @@ namespace PepperDash.Essentials.Core
&& RouteDescriptors.Any(t => t.Destination == descriptor.Destination && t.InputPort != null && descriptor.InputPort != null && t.InputPort.Key == descriptor.InputPort.Key)) && RouteDescriptors.Any(t => t.Destination == descriptor.Destination && t.InputPort != null && descriptor.InputPort != null && t.InputPort.Key == descriptor.InputPort.Key))
{ {
Debug.LogMessage(LogEventLevel.Debug, descriptor.Destination, Debug.LogMessage(LogEventLevel.Debug, descriptor.Destination,
"Route to [{0}] already exists in global routes table", descriptor.Source.Key); "Route to [{0}] already exists in global routes table", descriptor?.Source?.Key);
return; return;
} }
RouteDescriptors.Add(descriptor); RouteDescriptors.Add(descriptor);