show url and id in errors
authorDobrica Pavlinusic <dpavlin@rot13.org>
Wed, 8 Dec 2010 18:55:12 +0000 (19:55 +0100)
committerDobrica Pavlinusic <dpavlin@rot13.org>
Wed, 8 Dec 2010 18:56:52 +0000 (19:56 +0100)
couchdb-trigger.pl

index 77fa41c..db5acb0 100755 (executable)
@@ -81,7 +81,7 @@ while( ! $error ) {
                                                                if ( $tx->res->code == 409 ) {
                                                                        info "TRIGGER ABORTED started on another worker? ", $tx->error;
                                                                } else {
-                                                                       info "ERROR ", $tx->error;
+                                                                       info "ERROR $url/$id ", $tx->error;
                                                                }
                                                        } else {
                                                                my $res = $tx->res->json;
@@ -95,7 +95,7 @@ while( ! $error ) {
                                                                $client->put( "$url/$id" => $json->encode( $change->{doc} ) => sub {
                                                                        my ($client,$tx) = @_;
                                                                        if ($tx->error) {
-                                                                               info "ERROR", $tx->error;
+                                                                               info "ERROR $url/$id", $tx->error;
                                                                        } else {
                                                                                my $res = $tx->res->json;
                                                                                $change->{doc}->{_rev} = $res->{rev};