diff --git a/PepperDashEssentials/AppServer/CotijaSystemController.cs b/PepperDashEssentials/AppServer/CotijaSystemController.cs index 44b007ef..92704711 100644 --- a/PepperDashEssentials/AppServer/CotijaSystemController.cs +++ b/PepperDashEssentials/AppServer/CotijaSystemController.cs @@ -458,10 +458,11 @@ namespace PepperDash.Essentials var result = WSClient.Send(messageBytes, (uint)messageBytes.Length, WebSocketClient.WEBSOCKET_PACKET_TYPES.LWS_WS_OPCODE_07__TEXT_FRAME); if (result != WebSocketClient.WEBSOCKET_RESULT_CODES.WEBSOCKET_CLIENT_SUCCESS) { +#warning It seems like this debug statement is throwing an exception when called Debug.Console(1, this, "Socket send result error: {0}", result); } } - else if (!WSClient.Connected) + else if (WSClient == null) { Debug.Console(1, this, "Cannot send. Not connected {0}"); } diff --git a/PepperDashEssentials/AppServer/Messengers/ConfigMessenger.cs b/PepperDashEssentials/AppServer/Messengers/ConfigMessenger.cs index a54a9b9f..1e3cfa12 100644 --- a/PepperDashEssentials/AppServer/Messengers/ConfigMessenger.cs +++ b/PepperDashEssentials/AppServer/Messengers/ConfigMessenger.cs @@ -32,16 +32,24 @@ namespace PepperDash.Essentials.AppServer.Messengers appServerController.AddAction(MessagePath + "/updateConfig", new Action(s => GetConfigFile(s))); } + /// + /// Generates or passes the URL to make the request to GET the config from a server + /// + /// void GetConfigFile(string url) { try { + // Attempt to parse the URL var parser = new Crestron.SimplSharp.Net.Http.UrlParser(url); Debug.Console(0, Debug.ErrorLogLevel.Notice, "Successfully parsed URL from AppServer message: {0}", parser.Url); } - catch + catch (Exception e) { + // If unable to parse the URL, generate it from config data + Debug.Console(2, "Error parsing URL: {0}", e); + Debug.Console(0, Debug.ErrorLogLevel.Notice, "Unable to parse URL from AppServer message. Generating URL from config data"); url = string.Format("http://{0}/api/system/{1}/config", AppServerController.Config.ServerUrl, AppServerController.SystemUuid); } diff --git a/essentials-framework b/essentials-framework index 1393abd8..07171276 160000 --- a/essentials-framework +++ b/essentials-framework @@ -1 +1 @@ -Subproject commit 1393abd812273e57b2802837331c23be5ccaf5a8 +Subproject commit 071712762dba2d25c6ef186cc8b7237ea4aa774d