Explorar o código

add $e->getLine()

visuddhinanda %!s(int64=4) %!d(string=hai) anos
pai
achega
38df8451bf
Modificáronse 1 ficheiros con 5 adicións e 2 borrados
  1. 5 2
      app/install/db_insert_wordindex_from_csv_cli.php

+ 5 - 2
app/install/db_insert_wordindex_from_csv_cli.php

@@ -45,7 +45,8 @@ try{
 				try{
 					$stmt = $dbh_word_index->prepare($query);
 				}catch(PDOException $e){
-					fwrite(STDERR,"error:".$e->getMessage());
+					fwrite(STDERR,"error:".$e->getMessage()." At Line: ".$e->getLine().PHP_EOL);
+					exit;
 				}
                 
         
@@ -54,7 +55,9 @@ try{
 					try{
 						$stmt->execute($data);
 					}catch(PDOException $e){
-						fwrite(STDERR,"error:".$e->getMessage());
+						fwrite(STDERR,"error:".$e->getMessage()." At Line: ".$e->getLine().PHP_EOL);
+						fwrite(STDERR,"error-data:".implode(",",$data).PHP_EOL);
+						exit;
 					}
                     
                     $count++;