Преглед изворни кода

Croak instead of die in upload_file

This makes the error message indicate where the caller provided us with
an invalid file, instead of telling the caller what line of our module
we died on. I think the former is more useful.
Daniel Gempesaw пре 10 година
родитељ
комит
db58c8f91e
1 измењених фајлова са 1 додато и 1 уклоњено
  1. 1 1
      lib/Selenium/Remote/Driver.pm

+ 1 - 1
lib/Selenium/Remote/Driver.pm

@@ -2581,7 +2581,7 @@ sub upload_file {
 sub _prepare_file {
 sub _prepare_file {
     my ($self,$filename) = @_;
     my ($self,$filename) = @_;
 
 
-    if ( not -r $filename ) { die "upload_file: no such file: $filename"; }
+    if ( not -r $filename ) { croak "upload_file: no such file: $filename"; }
     my $string = "";    # buffer
     my $string = "";    # buffer
     my $zip = Archive::Zip->new();
     my $zip = Archive::Zip->new();
     $zip->addFile($filename, basename($filename));
     $zip->addFile($filename, basename($filename));