diff --git a/hibernate-core/src/main/java/org/hibernate/tool/hbm2ddl/SchemaExport.java b/hibernate-core/src/main/java/org/hibernate/tool/hbm2ddl/SchemaExport.java index 3130430c3d..407659fd18 100644 --- a/hibernate-core/src/main/java/org/hibernate/tool/hbm2ddl/SchemaExport.java +++ b/hibernate-core/src/main/java/org/hibernate/tool/hbm2ddl/SchemaExport.java @@ -448,7 +448,13 @@ public class SchemaExport { } } catch ( Exception e ) { - throw new ImportScriptException( "Error during statement execution (file: '" + namedReader.getName() + "'): " + trimmedSql, e ); + if (haltOnError) { + throw new ImportScriptException( "Error during statement execution (file: '" + + namedReader.getName() + "'): " + trimmedSql, e ); + } + exceptions.add(e); + LOG.unsuccessful(trimmedSql); + LOG.error(e.getMessage()); } } }