Skip to content
This repository has been archived by the owner on May 9, 2023. It is now read-only.

Added check if API init error is recoverable to console samples #3

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -75,8 +75,16 @@ public void ttApiInitComplete(TTAPI api, ApiCreationException ex)
}
else
{
Console.WriteLine("TT API Initialization Failed: {0}", ex.Message);
Dispose();
if (ex.IsRecoverable == true)
{
// This error is recoverable and can be waited out
Console.WriteLine("Waiting for TT API to start");

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would also add the ex.Message to the the message

}
else
{
Console.WriteLine("TT API Initialization Failed: {0}", ex.Message);
Dispose();
}
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -84,8 +84,16 @@ public void ttApiInitComplete(TTAPI api, ApiCreationException ex)
}
else
{
Console.WriteLine("TT API Initialization Failed: {0}", ex.Message);
Dispose();
if (ex.IsRecoverable == true)
{
// This error is recoverable and can be waited out
Console.WriteLine("Waiting for TT API to start");
}
else
{
Console.WriteLine("TT API Initialization Failed: {0}", ex.Message);
Dispose();
}
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -75,8 +75,16 @@ public void ttApiInitComplete(TTAPI api, ApiCreationException ex)
}
else
{
Console.WriteLine("TT API Initialization Failed: {0}", ex.Message);
Dispose();
if (ex.IsRecoverable == true)
{
// This error is recoverable and can be waited out
Console.WriteLine("Waiting for TT API to start");
}
else
{
Console.WriteLine("TT API Initialization Failed: {0}", ex.Message);
Dispose();
}
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -95,8 +95,16 @@ public void ttApiInitComplete(TTAPI api, ApiCreationException ex)
}
else
{
Console.WriteLine("TT API Initialization Failed: {0}", ex.Message);
Dispose();
if (ex.IsRecoverable == true)
{
// This error is recoverable and can be waited out
Console.WriteLine("Waiting for TT API to start");
}
else
{
Console.WriteLine("TT API Initialization Failed: {0}", ex.Message);
Dispose();
}
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -76,8 +76,16 @@ public void ttApiInitComplete(TTAPI api, ApiCreationException ex)
}
else
{
Console.WriteLine("TT API Initialization Failed: {0}", ex.Message);
Dispose();
if (ex.IsRecoverable == true)
{
// This error is recoverable and can be waited out
Console.WriteLine("Waiting for TT API to start");
}
else
{
Console.WriteLine("TT API Initialization Failed: {0}", ex.Message);
Dispose();
}
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -76,8 +76,16 @@ public void ttApiInitComplete(TTAPI api, ApiCreationException ex)
}
else
{
Console.WriteLine("TT API Initialization Failed: {0}", ex.Message);
Dispose();
if (ex.IsRecoverable == true)
{
// This error is recoverable and can be waited out
Console.WriteLine("Waiting for TT API to start");
}
else
{
Console.WriteLine("TT API Initialization Failed: {0}", ex.Message);
Dispose();
}
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -80,8 +80,16 @@ public void ttApiInitComplete(TTAPI api, ApiCreationException ex)
}
else
{
Console.WriteLine("TT API Initialization Failed: {0}", ex.Message);
Dispose();
if (ex.IsRecoverable == true)
{
// This error is recoverable and can be waited out
Console.WriteLine("Waiting for TT API to start");
}
else
{
Console.WriteLine("TT API Initialization Failed: {0}", ex.Message);
Dispose();
}
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -76,8 +76,16 @@ public void ttApiInitComplete(TTAPI api, ApiCreationException ex)
}
else
{
Console.WriteLine("TT API Initialization Failed: {0}", ex.Message);
Dispose();
if (ex.IsRecoverable == true)
{
// This error is recoverable and can be waited out
Console.WriteLine("Waiting for TT API to start");
}
else
{
Console.WriteLine("TT API Initialization Failed: {0}", ex.Message);
Dispose();
}
}
}

Expand Down