Display error codes when the connection is terminated

This commit is contained in:
Cameron Gutman
2023-12-30 21:14:22 -06:00
parent a102ec4ee8
commit 69387c32ad
2 changed files with 12 additions and 2 deletions

View File

@@ -2371,7 +2371,16 @@ public class Game extends Activity implements SurfaceHolder.Callback,
break;
default:
message = getResources().getString(R.string.conn_terminated_msg);
String errorCodeString;
// We'll assume large errors are hex values
if (Math.abs(errorCode) > 1000) {
errorCodeString = Integer.toHexString(errorCode);
}
else {
errorCodeString = Integer.toString(errorCode);
}
message = getResources().getString(R.string.conn_terminated_msg) + "\n\n" +
getResources().getString(R.string.error_code_prefix) + " " + errorCodeString;
break;
}
}