private void WriteOrThrowAadExceptionMessage(AadAuthenticationException aadEx) { if (aadEx is AadAuthenticationFailedWithoutPopupException) { WriteDebugMessage(aadEx.Message); } else if (aadEx is AadAuthenticationCanceledException) { WriteWarningMessage(aadEx.Message); } else { throw aadEx; } }