Permalink
Browse files

Show actual errors rather than Internal Server Errors

(Broken by 1ac66e3)
  • Loading branch information...
1 parent f83194a commit 3a184e4cfc5c1515c4edd7f3067cd02fbd08ce12 @dgl committed Jul 26, 2012
Showing with 8 additions and 2 deletions.
  1. +8 −2 lib/WWW/CPANGrep.pm
View
10 lib/WWW/CPANGrep.pm
@@ -99,9 +99,15 @@ sub render_response {
->select('input[name="q"]')->add_to_attribute(value => $q);
if($error || !@$results) {
+ if($error) {
+ $output = $output->select('.divider')->replace_content("Error");
+ } else {
+ $output = $output->select('#result-count')->replace_content(" ")
+ ->select('#time')->replace_content(
+ $duration ? sprintf "%0.2f", $duration: "")
+ }
+
return $output
- ->select('#result-count')->replace_content(" ")
- ->select('#time')->replace_content(sprintf "%0.2f", $duration)
->select('.result')->replace_content($error || "No matches found.")
->select('.pagination')->replace("");
}

0 comments on commit 3a184e4

Please sign in to comment.