message in try catch
This commit is contained in:
@@ -34,8 +34,16 @@ namespace CardMarketServer
|
|||||||
{
|
{
|
||||||
while (true)
|
while (true)
|
||||||
{
|
{
|
||||||
string message = reader.ReadString();
|
string? message;
|
||||||
|
try
|
||||||
|
{
|
||||||
|
message = reader.ReadString();
|
||||||
|
}
|
||||||
|
catch(FormatException)
|
||||||
|
{
|
||||||
|
Console.WriteLine("Formatexception ");
|
||||||
|
continue;
|
||||||
|
}
|
||||||
if (message != null)
|
if (message != null)
|
||||||
{
|
{
|
||||||
EACTION action = EACTION.NONE;
|
EACTION action = EACTION.NONE;
|
||||||
@@ -43,7 +51,7 @@ namespace CardMarketServer
|
|||||||
if(parts.Length < 3)
|
if(parts.Length < 3)
|
||||||
{
|
{
|
||||||
Console.WriteLine($"Fehler {message}");
|
Console.WriteLine($"Fehler {message}");
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (parts[1].Equals("TEST")) action = EACTION.TEST;
|
if (parts[1].Equals("TEST")) action = EACTION.TEST;
|
||||||
|
|||||||
Reference in New Issue
Block a user