Skip to content
Snippets Groups Projects
Commit 262879f9 authored by brinn's avatar brinn
Browse files

fix: wrong handling of corner cases (used to throw a CheckedExceptionTunnel...

fix: wrong handling of corner cases (used to throw a CheckedExceptionTunnel instead of a ConfigurationFailureException)

SVN: 3347
parent c1f18667
No related branches found
No related tags found
No related merge requests found
...@@ -135,13 +135,13 @@ public class H2AdminDAO extends SimpleJdbcDaoSupport implements IDatabaseAdminDA ...@@ -135,13 +135,13 @@ public class H2AdminDAO extends SimpleJdbcDaoSupport implements IDatabaseAdminDA
throws ConfigurationFailureException throws ConfigurationFailureException
{ {
final File scriptFile = new File(dumpFolder, prefix + "-" + version + SQL_FILE_TYPE); final File scriptFile = new File(dumpFolder, prefix + "-" + version + SQL_FILE_TYPE);
final Script script = new Script(scriptFile.getPath(), FileUtilities.loadToString(scriptFile), version); if (scriptFile.canRead() == false)
if (script == null)
{ {
final String message = "No " + prefix + " script found for version " + version; final String message = "No " + prefix + " script found for version " + version;
operationLog.error(message); operationLog.error(message);
throw new ConfigurationFailureException(message); throw new ConfigurationFailureException(message);
} }
final Script script = new Script(scriptFile.getPath(), FileUtilities.loadToString(scriptFile), version);
return script; return script;
} }
......
...@@ -183,13 +183,13 @@ public class PostgreSQLAdminDAO extends SimpleJdbcDaoSupport implements IDatabas ...@@ -183,13 +183,13 @@ public class PostgreSQLAdminDAO extends SimpleJdbcDaoSupport implements IDatabas
throws ConfigurationFailureException throws ConfigurationFailureException
{ {
final File scriptFile = new File(dumpFolder, prefix + "-" + version + SQL_FILE_TYPE); final File scriptFile = new File(dumpFolder, prefix + "-" + version + SQL_FILE_TYPE);
final Script script = new Script(scriptFile.getPath(), FileUtilities.loadToString(scriptFile), version); if (scriptFile.canRead() == false)
if (script == null)
{ {
final String message = "No " + prefix + " script found for version " + version; final String message = "No " + prefix + " script found for version " + version;
operationLog.error(message); operationLog.error(message);
throw new ConfigurationFailureException(message); throw new ConfigurationFailureException(message);
} }
final Script script = new Script(scriptFile.getPath(), FileUtilities.loadToString(scriptFile), version);
return script; return script;
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment