diff options
author | Andrew Arnott <andrewarnott@gmail.com> | 2009-11-08 21:01:01 -0800 |
---|---|---|
committer | Andrew Arnott <andrewarnott@gmail.com> | 2009-11-08 21:01:01 -0800 |
commit | 067a1547b04ae77236ba055244615f1d6a78a813 (patch) | |
tree | 7526679351fcecf573a1807d8f62751f57db5e64 | |
parent | 2d81a0aae02561518c006247736e2cfe0c9a1400 (diff) | |
download | DotNetOpenAuth-067a1547b04ae77236ba055244615f1d6a78a813.zip DotNetOpenAuth-067a1547b04ae77236ba055244615f1d6a78a813.tar.gz DotNetOpenAuth-067a1547b04ae77236ba055244615f1d6a78a813.tar.bz2 |
Publicized the exception inner message assembling routine.
And utilize it in the OpenIdLogin control and the project starter template.
4 files changed, 5 insertions, 5 deletions
diff --git a/projecttemplates/WebFormsRelyingParty/LoginFrame.aspx.cs b/projecttemplates/WebFormsRelyingParty/LoginFrame.aspx.cs index e41d167..10461d4 100644 --- a/projecttemplates/WebFormsRelyingParty/LoginFrame.aspx.cs +++ b/projecttemplates/WebFormsRelyingParty/LoginFrame.aspx.cs @@ -36,13 +36,13 @@ protected void openIdSelector_Failed(object sender, OpenIdEventArgs e) { if (e.Response.Exception != null) { - this.errorMessageLabel.Text = e.Response.Exception.Message; + this.errorMessageLabel.Text = e.Response.Exception.ToStringDescriptive(); } this.errorPanel.Visible = true; } protected void openIdSelector_TokenProcessingError(object sender, TokenProcessingErrorEventArgs e) { - this.errorMessageLabel.Text = e.Exception.Message; + this.errorMessageLabel.Text = e.Exception.ToStringDescriptive(); this.errorPanel.Visible = true; } diff --git a/src/DotNetOpenAuth/Messaging/MessagingUtilities.cs b/src/DotNetOpenAuth/Messaging/MessagingUtilities.cs index b1a253d..ba68227 100644 --- a/src/DotNetOpenAuth/Messaging/MessagingUtilities.cs +++ b/src/DotNetOpenAuth/Messaging/MessagingUtilities.cs @@ -193,7 +193,7 @@ namespace DotNetOpenAuth.Messaging { /// </summary> /// <param name="exception">The exception.</param> /// <returns>The assembled message.</returns> - internal static string GetAllMessages(this Exception exception) { + public static string ToStringDescriptive(this Exception exception) { // The input being null is probably bad, but since this method is called // from a catch block, we don't really want to throw a new exception and // hide the details of this one. diff --git a/src/DotNetOpenAuth/OpenId/Provider/OpenIdProvider.cs b/src/DotNetOpenAuth/OpenId/Provider/OpenIdProvider.cs index f141834..3eb24d4 100644 --- a/src/DotNetOpenAuth/OpenId/Provider/OpenIdProvider.cs +++ b/src/DotNetOpenAuth/OpenId/Provider/OpenIdProvider.cs @@ -488,7 +488,7 @@ namespace DotNetOpenAuth.OpenId.Provider { return null; } - errorMessage.ErrorMessage = ex.GetAllMessages(); + errorMessage.ErrorMessage = ex.ToStringDescriptive(); // Allow host to log this error and issue a ticket #. // We tear off the field to a local var for thread safety. diff --git a/src/DotNetOpenAuth/OpenId/RelyingParty/OpenIdLogin.cs b/src/DotNetOpenAuth/OpenId/RelyingParty/OpenIdLogin.cs index 3e13ef0..f89ec0a 100644 --- a/src/DotNetOpenAuth/OpenId/RelyingParty/OpenIdLogin.cs +++ b/src/DotNetOpenAuth/OpenId/RelyingParty/OpenIdLogin.cs @@ -831,7 +831,7 @@ idselector_input_id = '" + this.ClientID + @"'; base.OnFailed(response); if (!string.IsNullOrEmpty(this.FailedMessageText)) { - this.errorLabel.Text = string.Format(CultureInfo.CurrentCulture, this.FailedMessageText, response.Exception.Message); + this.errorLabel.Text = string.Format(CultureInfo.CurrentCulture, this.FailedMessageText, response.Exception.ToStringDescriptive()); this.errorLabel.Visible = true; } } |