Skip to content

Commit

Permalink
address PR feedback
Browse files Browse the repository at this point in the history
  • Loading branch information
HP712 committed Oct 16, 2024
1 parent d466704 commit 2312347
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -39,11 +39,7 @@ public AudienceValidationError(
/// <returns>An instance of an Exception.</returns>
internal override Exception GetException()
{
if (ExceptionType == typeof(SecurityTokenArgumentNullException))
{
return new SecurityTokenArgumentNullException(MessageDetail.Message);
}
else if (ExceptionType == typeof(SecurityTokenInvalidAudienceException))
if (ExceptionType == typeof(SecurityTokenInvalidAudienceException))
return new SecurityTokenInvalidAudienceException(MessageDetail.Message) { InvalidAudience = Utility.SerializeAsSingleCommaDelimitedString(_tokenAudiences) };

return base.GetException(ExceptionType, null);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,9 @@ internal Exception GetException(Type exceptionType, Exception innerException)

if (innerException == null && InnerValidationError == null)
{
if (exceptionType == typeof(SecurityTokenInvalidAudienceException))
if (exceptionType == typeof(SecurityTokenArgumentNullException))
return new SecurityTokenArgumentNullException(MessageDetail.Message);
else if (exceptionType == typeof(SecurityTokenInvalidAudienceException))
exception = new SecurityTokenInvalidAudienceException(MessageDetail.Message);
else if (exceptionType == typeof(SecurityTokenInvalidIssuerException))
exception = new SecurityTokenInvalidIssuerException(MessageDetail.Message);
Expand Down Expand Up @@ -120,7 +122,9 @@ internal Exception GetException(Type exceptionType, Exception innerException)
{
Exception actualException = innerException ?? InnerValidationError.GetException();

if (exceptionType == typeof(SecurityTokenInvalidAudienceException))
if (exceptionType == typeof(SecurityTokenArgumentNullException))
return new SecurityTokenArgumentNullException(MessageDetail.Message, innerException);
else if (exceptionType == typeof(SecurityTokenInvalidAudienceException))
exception = new SecurityTokenInvalidAudienceException(MessageDetail.Message, actualException);
else if (exceptionType == typeof(SecurityTokenInvalidIssuerException))
exception = new SecurityTokenInvalidIssuerException(MessageDetail.Message, actualException);
Expand Down

0 comments on commit 2312347

Please sign in to comment.