Use dedicated catch block for ScriptException

Closes gh-24383
This commit is contained in:
Hyunjin Choi 2020-02-04 22:45:52 +09:00 committed by GitHub
parent 7575616d26
commit 1acf5a7424
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 4 additions and 4 deletions

View File

@ -1,5 +1,5 @@
/*
* Copyright 2002-2017 the original author or authors.
* Copyright 2002-2020 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@ -52,10 +52,10 @@ public abstract class DatabasePopulatorUtils {
DataSourceUtils.releaseConnection(connection, dataSource);
}
}
catch (ScriptException ex){
throw ex;
}
catch (Throwable ex) {
if (ex instanceof ScriptException) {
throw (ScriptException) ex;
}
throw new UncategorizedScriptException("Failed to execute database script", ex);
}
}