Write logging in case a Matcher throws an exception (#986)

* ThrowException

* ...

* .

* ...

* b

* fix test

* ...

* .

* sonar

* ft

* .

* fix tst
This commit is contained in:
Stef Heyenrath
2023-08-21 20:07:46 +02:00
committed by GitHub
parent 09a302baf2
commit 93c87845c2
88 changed files with 1266 additions and 1244 deletions
@@ -34,8 +34,6 @@ internal class AzureADAuthenticationMatcher : IStringMatcher
public MatchBehaviour MatchBehaviour => MatchBehaviour.AcceptOnMatch;
public bool ThrowException => false;
public AnyOf<string, StringPattern>[] GetPatterns()
{
return EmptyArray<AnyOf<string, StringPattern>>.Value;
@@ -43,7 +41,7 @@ internal class AzureADAuthenticationMatcher : IStringMatcher
public MatchOperator MatchOperator { get; } = MatchOperator.Or;
public double IsMatch(string? input)
public MatchResult IsMatch(string? input)
{
if (string.IsNullOrEmpty(input))
{
@@ -70,9 +68,9 @@ internal class AzureADAuthenticationMatcher : IStringMatcher
return MatchScores.Perfect;
}
catch
catch (Exception ex)
{
return MatchScores.Mismatch;
return new MatchResult(MatchScores.Mismatch, ex);
}
}
}