Display error codes when the connection is terminated

This commit is contained in:
Cameron Gutman 2023-12-22 14:46:23 -06:00
parent 951289a802
commit 77485f2d8d
2 changed files with 14 additions and 2 deletions

View File

@ -439,11 +439,23 @@
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;
}
}
}
UIAlertController* conTermAlert = [UIAlertController alertControllerWithTitle:title
message:message

@ -1 +1 @@
Subproject commit 3ed3ba62534ce06c1b97fec46722969e7710fee6
Subproject commit 3aae4cdc595ff6f428a2abbfb9d5055c03423bc2