--- trunk/Estraier.pm 2006/01/28 19:46:20 102 +++ trunk/Estraier.pm 2006/01/28 20:44:15 103 @@ -1172,12 +1172,14 @@ my $id = $node->uri_to_id( 'file:///document/uri/42' ); +This method won't croak, even if using C. + =cut sub uri_to_id { my $self = shift; my $uri = shift || return; - return $self->_fetch_doc( uri => $uri, path => '/uri_to_id', chomp_resbody => 1 ); + return $self->_fetch_doc( uri => $uri, path => '/uri_to_id', chomp_resbody => 1, croak_on_error => 0 ); } @@ -1237,6 +1239,7 @@ 'application/x-www-form-urlencoded', $arg, \$resbody, + $a->{croak_on_error}, ); return if ($rv != 200); @@ -1505,7 +1508,9 @@ sub shuttle_url { my $self = shift; - my ($url, $content_type, $reqbody, $resbody) = @_; + my ($url, $content_type, $reqbody, $resbody, $croak_on_error) = @_; + + $croak_on_error = $self->{croak_on_error} unless defined($croak_on_error); $self->{status} = -1; @@ -1549,7 +1554,7 @@ ($self->{status}, $self->{status_message}) = split(/\s+/, $res->status_line, 2); if (! $res->is_success) { - if ($self->{croak_on_error}) { + if ($croak_on_error) { croak("can't get $url: ",$res->status_line); } else { return -1;