This is an automated email from the ASF dual-hosted git repository. cbrisson pushed a commit to branch VELOCITY-965 in repository https://gitbox.apache.org/repos/asf/velocity-engine.git
commit 9695b94a531561c2ba16cebac919b121d63287c0 Author: Claude Brisson <[email protected]> AuthorDate: Wed Aug 28 12:42:54 2024 +0200 Throw VelocityException instead of Error --- .../velocity/runtime/resource/loader/DataSourceResourceLoader.java | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/velocity-engine-core/src/main/java/org/apache/velocity/runtime/resource/loader/DataSourceResourceLoader.java b/velocity-engine-core/src/main/java/org/apache/velocity/runtime/resource/loader/DataSourceResourceLoader.java index ecb827f6..85ca3a1e 100644 --- a/velocity-engine-core/src/main/java/org/apache/velocity/runtime/resource/loader/DataSourceResourceLoader.java +++ b/velocity-engine-core/src/main/java/org/apache/velocity/runtime/resource/loader/DataSourceResourceLoader.java @@ -214,7 +214,7 @@ public class DataSourceResourceLoader extends ResourceLoader } catch (NamingException ne) { - throw new Error("could not lookup datasource for name: " + dataSourceName, ne); + throw new VelocityException("could not lookup datasource for name: " + dataSourceName, ne); } log.trace("DataSourceResourceLoader initialized."); @@ -239,7 +239,7 @@ public class DataSourceResourceLoader extends ResourceLoader } catch (Exception e) { - throw new Error("could not find database objects factory class", e); + throw new VelocityException("could not find database objects factory class", e); } log.trace("DataSourceResourceLoader initialized."); @@ -254,7 +254,7 @@ public class DataSourceResourceLoader extends ResourceLoader { if (factory != null) { - throw new Error("cannot change data source after initialization"); + throw new VelocityException("cannot change data source after initialization"); } this.dataSource = dataSource; }
