diff options
author | Andrew Arnott <andrewarnott@gmail.com> | 2009-03-25 21:44:02 -0700 |
---|---|---|
committer | Andrew Arnott <andrewarnott@gmail.com> | 2009-03-25 21:44:02 -0700 |
commit | 5477da58070c3dd4b4a7d9d18df085c26d3b8ae6 (patch) | |
tree | 844f9ee10ace987480208f7266987c7de6388e6b /src | |
parent | ac200ebac84ce798a16f580a2145c7160b0e29a8 (diff) | |
download | DotNetOpenAuth-5477da58070c3dd4b4a7d9d18df085c26d3b8ae6.zip DotNetOpenAuth-5477da58070c3dd4b4a7d9d18df085c26d3b8ae6.tar.gz DotNetOpenAuth-5477da58070c3dd4b4a7d9d18df085c26d3b8ae6.tar.bz2 |
Catches XmlExceptions thrown while processing tokens and fire the appropriate event.
Diffstat (limited to 'src')
-rw-r--r-- | src/DotNetOpenAuth/InfoCard/InfoCardSelector.cs | 26 |
1 files changed, 15 insertions, 11 deletions
diff --git a/src/DotNetOpenAuth/InfoCard/InfoCardSelector.cs b/src/DotNetOpenAuth/InfoCard/InfoCardSelector.cs index aa02ebe..3ca8e88 100644 --- a/src/DotNetOpenAuth/InfoCard/InfoCardSelector.cs +++ b/src/DotNetOpenAuth/InfoCard/InfoCardSelector.cs @@ -18,6 +18,7 @@ namespace DotNetOpenAuth.InfoCard { using System.Web.UI; using System.Web.UI.HtmlControls; using System.Web.UI.WebControls; + using System.Xml; using DotNetOpenAuth.Messaging; /// <summary> @@ -376,18 +377,21 @@ namespace DotNetOpenAuth.InfoCard { /// <param name="eventArgument">A <see cref="T:System.String"/> that represents an optional event argument to be passed to the event handler.</param> public void RaisePostBackEvent(string eventArgument) { if (!string.IsNullOrEmpty(this.TokenXml)) { - bool encrypted = Token.IsEncrypted(this.TokenXml); - TokenDecryptor decryptor = encrypted ? new TokenDecryptor() : null; - ReceivingTokenEventArgs receivingArgs = this.OnReceivingToken(this.TokenXml, decryptor); - - if (!receivingArgs.Cancel) { - try { - Token token = new Token(this.TokenXml, this.Audience, decryptor); - this.OnReceivedToken(token); - } catch (InformationCardException ex) { - this.OnTokenProcessingError(this.TokenXml, ex); - return; + try { + bool encrypted = Token.IsEncrypted(this.TokenXml); + TokenDecryptor decryptor = encrypted ? new TokenDecryptor() : null; + ReceivingTokenEventArgs receivingArgs = this.OnReceivingToken(this.TokenXml, decryptor); + + if (!receivingArgs.Cancel) { + try { + Token token = new Token(this.TokenXml, this.Audience, decryptor); + this.OnReceivedToken(token); + } catch (InformationCardException ex) { + this.OnTokenProcessingError(this.TokenXml, ex); + } } + } catch (XmlException ex) { + this.OnTokenProcessingError(this.TokenXml, ex); } } } |