Browse Source

fixed response handling: all bug 200 will generate warning

Alois Mahdal 12 years ago
parent
commit
aa80d50f92
1 changed files with 4 additions and 1 deletions
  1. 4
    1
      lib/htlogr.pm

+ 4
- 1
lib/htlogr.pm View File

@@ -47,7 +47,10 @@ sub log {
47 47
     $uri .= "?msg=" . uri_escape($msg);
48 48
     $uri .= "&tag=" . uri_escape($tag)  if $tag;
49 49
     $uri .= "&i="   . uri_escape($i)    if $i;
50
-    $self->{http}->request($uri) or croak("could not htlog message: $!");
50
+    my $response = $self->{http}->request($uri)
51
+        or croak("could not htlog message: $!");
52
+    carp("logging server returned error $response, message not logged")
53
+        unless $response eq "200";
51 54
     return $self->{http}->body();
52 55
 }
53 56