diff --git a/src/Import.php b/src/Import.php index de13bb0..e2e8249 100644 --- a/src/Import.php +++ b/src/Import.php @@ -61,9 +61,12 @@ protected function execute_statements( $import_file ) { $converted_statement = mb_convert_encoding( $statement, 'UTF-8', $detected_encoding ); echo 'Converted ecoding for statement: ' . $converted_statement . PHP_EOL; $this->driver->query( $converted_statement ); + } else { + // It's not an encoding issue, so rethrow the exception. + throw $e; } } catch ( Exception $e ) { - WP_CLI::warning( 'Could not execute statement: ' . $statement ); + WP_CLI::error( 'Could not execute statement: ' . $statement ); echo $e->getMessage(); } }