Skip to content
Browse files

Change fatal errors to warns

  • Loading branch information...
1 parent 60a55ea commit a99415842f151c92fc3295e9c083e594ccffc7eb @DimaD DimaD committed Oct 15, 2008
Showing with 11 additions and 4 deletions.
  1. +9 −4 lib/Catalyst/Plugin/Authentication/Credential/MyOpenID.pm
  2. +2 −0 lib/perlflow/Controller/User.pm
View
13 lib/Catalyst/Plugin/Authentication/Credential/MyOpenID.pm
@@ -40,7 +40,7 @@ sub authenticate {
my $current = $c->request->uri;
$current->query(undef); # no query
my $identity = $csr->claimed_identity($openid_url)
- or Catalyst::Exception->throw($csr->err);
+ or return _error( $c, $csr->err );
my $check_url = $identity->check_url(
return_to => $current . '?openid-check=1',
trust_root => $current,
@@ -59,16 +59,21 @@ sub authenticate {
qw( url display rss atom foaf declared_rss declared_atom declared_foaf foafmaker ) };
return $realm->find_user( $user, $c);
- return 1;
} else {
- Catalyst::Exception->throw("Error validating identity: " .
- $csr->err);
+ return _error( $c, "Error validating identity: " . $csr->err );
}
} else {
return 0;
}
}
+sub _error {
+ my ( $c, $msg ) = @_;
+
+ $c->log->warn( $msg );
+ return;
+}
+
1;
__END__
View
2 lib/perlflow/Controller/User.pm
@@ -14,6 +14,8 @@ sub login : Local {
if ( $c->authenticate( $c->request->param("openid_url") ) ) {
return $c->res->redirect( $c->uri_for('/') );
+ } else {
+ #auth error
}
}

0 comments on commit a994158

Please sign in to comment.
Something went wrong with that request. Please try again.