-
Notifications
You must be signed in to change notification settings - Fork 3
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Please do not die on errors #6
Comments
Dying is not in my design. Is it contain messages like |
You are calling croak, which is the same as die. Instead of calling croak, you should save the error message somewhere and return 0, I think. |
Calling croak is under my decision. But it is abnormal situation, and I need to know what situation makes such case. |
For example, call stat() on a file that does not exist. my $rh = $o->stat(q{/no/such/file}); This code dies with a JSON error (see below), it never prints "after the FileNotFoundError: {"RemoteException":{"message":"File does not exist:
On Sun, Mar 1, 2015 at 9:07 AM, TAGOMORI Satoshi notifications@github.com
|
I've just added my $client = Net::Hadoop::WebHDFS->new(..., suppress_errors => 1);
unless ($client->stat(q{/no/such/file})) {
say $client->{last_error};
} Can you test it? |
Some (most? all?) of the methods die if there is an error. For example, try to append onto a file that does not exist. Please DO NOT DIE on errors, that's what the return value of Boolean is for!
The text was updated successfully, but these errors were encountered: