mirror of
https://github.com/bitwarden/mobile.git
synced 2024-09-27 03:52:57 +02:00
PM-5154 Avoid logging Fido2AuthenticatorExceptions (#3169)
This commit is contained in:
parent
8a0501f0f9
commit
350a22d20e
@ -24,5 +24,23 @@ namespace Bit.Core.Utilities
|
||||
onException?.Invoke(ex);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Fires a task and ignores any exception.
|
||||
/// See http://stackoverflow.com/a/22864616/344182
|
||||
/// </summary>
|
||||
/// <param name="task">The task to be forgotten.</param>
|
||||
/// <param name="onException">Action to be called on exception.</param>
|
||||
public static async void FireAndForget(this Task task, Func<Exception, bool> shouldLogException)
|
||||
{
|
||||
try
|
||||
{
|
||||
await task.ConfigureAwait(false);
|
||||
}
|
||||
catch (Exception ex) when (shouldLogException(ex))
|
||||
{
|
||||
LoggerHelper.LogEvenIfCantBeResolved(ex);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -147,7 +147,7 @@ namespace Bit.iOS.Autofill
|
||||
CPViewController.VerifyUserAsync,
|
||||
Source.ReloadWithAllowedFido2Credentials);
|
||||
|
||||
DoFido2GetAssertionAsync(fido2UserInterface).FireAndForget();
|
||||
DoFido2GetAssertionAsync(fido2UserInterface).FireAndForget(ex => ex is not Fido2AuthenticatorException);
|
||||
}
|
||||
else
|
||||
{
|
||||
|
Loading…
Reference in New Issue
Block a user