Skip to content

Commit

Permalink
Added logger for handling connecting token error
Browse files Browse the repository at this point in the history
  • Loading branch information
sacOO7 committed Aug 11, 2023
1 parent 1cab5b8 commit e316f6c
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions src/IO.Ably.Shared/Realtime/Workflows/RealtimeCommands.cs
Original file line number Diff line number Diff line change
Expand Up @@ -378,14 +378,14 @@ private HandleConnectingTokenErrorCommand(ErrorInfo error)
Error = error;
}

public static RealtimeCommand Create(ErrorInfo error)
public static RealtimeCommand Create(ErrorInfo error, ILogger logger)
{
if (error == null || error.IsTokenError == false)
{
#if DEBUG
throw new ArgumentException("Cannot create a TokenError command with an error that is not a token error.");
#else
DefaultLogger.Warning("Cannot create a TokenError command with an error that is not a token error");
logger.Warning("Cannot create a TokenError command with an error that is not a token error");

// TODO: Sentry alert
return EmptyCommand.Instance;
Expand Down
2 changes: 1 addition & 1 deletion src/IO.Ably.Shared/Realtime/Workflows/RealtimeWorkflow.cs
Original file line number Diff line number Diff line change
Expand Up @@ -430,7 +430,7 @@ async Task AttemptANewConnection()

if (error.IsTokenError)
{
return HandleConnectingTokenErrorCommand.Create(error)
return HandleConnectingTokenErrorCommand.Create(error, Logger)
.TriggeredBy(cmd);
}

Expand Down

0 comments on commit e316f6c

Please sign in to comment.