Skip to content

Commit

Permalink
6.1.1.49 - improve exception message
Browse files Browse the repository at this point in the history
  • Loading branch information
michaeloffner committed Jul 18, 2024
1 parent 5ff16c5 commit 85ad80a
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 6 deletions.
12 changes: 8 additions & 4 deletions core/src/main/java/lucee/runtime/config/ConfigFactory.java
Original file line number Diff line number Diff line change
Expand Up @@ -220,14 +220,18 @@ static Struct loadDocumentCreateIfFails(Resource configFile, String type) throws
catch (Exception e) {
// rename buggy config files
if (configFile.exists()) {
LogUtil.log(ThreadLocalPageContext.getConfig(), Log.LEVEL_INFO, ConfigFactory.class.getName(),
"Config file [" + configFile + "] was not valid and has been replaced");
LogUtil.log(ThreadLocalPageContext.get(), ConfigFactory.class.getName(), e);
int count = 1;
Resource bugFile;
int count = 1;
Resource configDir = configFile.getParentResource();
while ((bugFile = configDir.getRealResource("lucee-" + type + "." + (count++) + ".buggy")).exists()) {
}

LogUtil.log(ThreadLocalPageContext.getConfig(), Log.LEVEL_INFO, ConfigFactory.class.getName(),
"The configuration file [" + configFile
+ "] contained syntax errors and could not be read. A new configuration file has been created, and the invalid file has been renamed to [" + bugFile
+ "].");
LogUtil.log(ThreadLocalPageContext.get(), ConfigFactory.class.getName(), e);

IOUtil.copy(configFile, bugFile);
configFile.delete();
}
Expand Down
2 changes: 1 addition & 1 deletion loader/build.xml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<project default="core" basedir="." name="Lucee"
xmlns:resolver="antlib:org.apache.maven.resolver.ant">

<property name="version" value="6.1.1.48-SNAPSHOT"/>
<property name="version" value="6.1.1.49-SNAPSHOT"/>

<taskdef uri="antlib:org.apache.maven.resolver.ant" resource="org/apache/maven/resolver/ant/antlib.xml">
<classpath>
Expand Down
2 changes: 1 addition & 1 deletion loader/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

<groupId>org.lucee</groupId>
<artifactId>lucee</artifactId>
<version>6.1.1.48-SNAPSHOT</version>
<version>6.1.1.49-SNAPSHOT</version>
<packaging>jar</packaging>

<name>Lucee Loader Build</name>
Expand Down

0 comments on commit 85ad80a

Please sign in to comment.