Skip to content

Commit bdd9349

Browse files
committed
Rethrow the error when the encoding is correct but the import query failed
1 parent 83be865 commit bdd9349

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

src/Import.php

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,9 @@ protected function execute_statements( $import_file ) {
6161
$converted_statement = mb_convert_encoding( $statement, 'UTF-8', $detected_encoding );
6262
echo 'Converted ecoding for statement: ' . $converted_statement . PHP_EOL;
6363
$this->driver->query( $converted_statement );
64+
} else {
65+
// It's not a encoding issue, so rethrow the exception.
66+
throw $e;
6467
}
6568
} catch ( Exception $e ) {
6669
WP_CLI::warning( 'Could not execute statement: ' . $statement );

0 commit comments

Comments
 (0)