Browse Source

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 năm trước cách đây
mục cha
commit
db58c8f91e
1 tập tin đã thay đổi với 1 bổ sung1 xóa
  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 {
     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 $zip = Archive::Zip->new();
     $zip->addFile($filename, basename($filename));