summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAndrew Arnott <andrewarnott@gmail.com>2009-03-09 15:01:17 -0700
committerAndrew Arnott <andrewarnott@gmail.com>2009-03-09 15:07:34 -0700
commit4499e8b1db764b944764d30f838d1b7c80a7e050 (patch)
treed37b80f8c5582e831b59acd408c3883109e63150
parent077238c1c9b12a6485fbf4c335e1b49af0c6279f (diff)
downloadDotNetOpenAuth-4499e8b1db764b944764d30f838d1b7c80a7e050.zip
DotNetOpenAuth-4499e8b1db764b944764d30f838d1b7c80a7e050.tar.gz
DotNetOpenAuth-4499e8b1db764b944764d30f838d1b7c80a7e050.tar.bz2
Fixed exception when a bad identifier is typed in (404 error, or others).
-rw-r--r--src/DotNetOpenAuth/OpenId/RelyingParty/AuthenticationRequest.cs8
1 files changed, 7 insertions, 1 deletions
diff --git a/src/DotNetOpenAuth/OpenId/RelyingParty/AuthenticationRequest.cs b/src/DotNetOpenAuth/OpenId/RelyingParty/AuthenticationRequest.cs
index c7d0bae..3a618ab 100644
--- a/src/DotNetOpenAuth/OpenId/RelyingParty/AuthenticationRequest.cs
+++ b/src/DotNetOpenAuth/OpenId/RelyingParty/AuthenticationRequest.cs
@@ -280,7 +280,13 @@ namespace DotNetOpenAuth.OpenId.RelyingParty {
ErrorUtilities.VerifyProtocol(realm.Contains(returnToUrl), OpenIdStrings.ReturnToNotUnderRealm, returnToUrl, realm);
// Perform discovery right now (not deferred).
- var serviceEndpoints = userSuppliedIdentifier.Discover(relyingParty.WebRequestHandler);
+ IEnumerable<ServiceEndpoint> serviceEndpoints;
+ try {
+ serviceEndpoints = userSuppliedIdentifier.Discover(relyingParty.WebRequestHandler);
+ } catch (ProtocolException ex) {
+ Logger.ErrorFormat("Error while performing discovery on: \"{0}\": {1}", userSuppliedIdentifier, ex);
+ serviceEndpoints = EmptyList<ServiceEndpoint>.Instance;
+ }
// Call another method that defers request generation.
return CreateInternal(userSuppliedIdentifier, relyingParty, realm, returnToUrl, serviceEndpoints, createNewAssociationsAsNeeded);