Skip to content

Commit

Permalink
Merge pull request #1603 from mapfish/backport/1602-to-3.26
Browse files Browse the repository at this point in the history
[Backport 3.26] Add some error message
  • Loading branch information
sbrunner authored Nov 20, 2020
2 parents abefd78 + 10c217c commit 96a5a88
Showing 1 changed file with 10 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,12 @@ public final synchronized MapPrinter create(@Nullable final String app) throws N
}

if (configFile == null) {
LOGGER.error(
"There is no configurationFile registered in the {}" +
" bean with the id: '{}' from configurationFiles:\n {}",
getClass().getName(), finalApp,
String.join("\n", this.configurationFiles.keySet())
);
throw new NoSuchAppException(
"There is no configurationFile registered in the " + getClass().getName() +
" bean with the id: '" + finalApp + "'");
Expand All @@ -86,7 +92,10 @@ public final synchronized MapPrinter create(@Nullable final String app) throws N
try {
configFileLastModified = this.configFileLoader.lastModified(configFile);
} catch (NoSuchElementException e) {
// the app has been removed
LOGGER.error(
"There is no configurationFile registered in the {}" +
" bean with the id: '{}'", getClass().getName(), finalApp);
// The app has been removed
this.configurationFiles.remove(finalApp);
this.configurationFileLastModifiedTimes.remove(finalApp);
this.printers.remove(finalApp);
Expand Down

0 comments on commit 96a5a88

Please sign in to comment.