From 77485f2d8dd629fddc1239d208c4c04230011d34 Mon Sep 17 00:00:00 2001 From: Cameron Gutman Date: Fri, 22 Dec 2023 14:46:23 -0600 Subject: [PATCH] Display error codes when the connection is terminated --- .../ViewControllers/StreamFrameViewController.m | 14 +++++++++++++- moonlight-common/moonlight-common-c | 2 +- 2 files changed, 14 insertions(+), 2 deletions(-) diff --git a/Limelight/ViewControllers/StreamFrameViewController.m b/Limelight/ViewControllers/StreamFrameViewController.m index 7720a9ff..a4c8f344 100644 --- a/Limelight/ViewControllers/StreamFrameViewController.m +++ b/Limelight/ViewControllers/StreamFrameViewController.m @@ -439,9 +439,21 @@ break; default: + { + NSString* errorString; + if (abs(errorCode) > 1000) { + // We'll assume large errors are hex values + errorString = [NSString stringWithFormat:@"%08X", (uint32_t)errorCode]; + } + else { + // Smaller values will just be printed as decimal (probably errno.h values) + errorString = [NSString stringWithFormat:@"%d", errorCode]; + } + title = @"Connection Terminated"; - message = @"The connection was terminated"; + message = [NSString stringWithFormat: @"The connection was terminated\n\nError code: %@", errorString]; break; + } } } diff --git a/moonlight-common/moonlight-common-c b/moonlight-common/moonlight-common-c index 3ed3ba62..3aae4cdc 160000 --- a/moonlight-common/moonlight-common-c +++ b/moonlight-common/moonlight-common-c @@ -1 +1 @@ -Subproject commit 3ed3ba62534ce06c1b97fec46722969e7710fee6 +Subproject commit 3aae4cdc595ff6f428a2abbfb9d5055c03423bc2