Просмотр исходного кода

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 лет назад
Родитель
Сommit
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 {
     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));