Summary
Several async code paths use empty catch { } blocks that silently swallow exceptions, making failures invisible and debugging difficult.
Locations
| File |
Line |
Context |
Teams.Apps/App.cs |
302-303 |
Token retrieval failure silently ignored |
Teams.Apps/Contexts/Context.SignIn.cs |
71 |
OAuth token exchange failure silently ignored |
Plugins.External.McpClient/McpClientPlugin.cs |
137-145 |
All exceptions from Task.WhenAll swallowed (comment says handled later, but pattern is fragile) |
Impact
- Authentication/token failures become invisible — users see downstream errors with no root cause
- OAuth flow failures are masked — sign-in silently fails without any indication of why
- MCP tool fetching errors could be lost if the downstream handling has bugs
Suggested fix
At minimum, log the exception before suppressing it. Where the exception represents a recoverable condition, catch the specific exception type rather than using a bare catch. Where the intent is "try but don't fail", use a pattern like:
catch (Exception ex) when (LogAndSuppress(ex))
{
}
or simply:
catch (Exception ex)
{
_logger.Warning("Token retrieval failed, proceeding without token", ex);
}
Summary
Several async code paths use empty
catch { }blocks that silently swallow exceptions, making failures invisible and debugging difficult.Locations
Teams.Apps/App.csTeams.Apps/Contexts/Context.SignIn.csPlugins.External.McpClient/McpClientPlugin.csTask.WhenAllswallowed (comment says handled later, but pattern is fragile)Impact
Suggested fix
At minimum, log the exception before suppressing it. Where the exception represents a recoverable condition, catch the specific exception type rather than using a bare
catch. Where the intent is "try but don't fail", use a pattern like:or simply: