Skip to content

Commit

Permalink
Handle extraproperties storage that can't be read or written
Browse files Browse the repository at this point in the history
- Log more informative error message when the repository instantiation fails

Resolves: https://www.pivotaltracker.com/story/show/73575994
  • Loading branch information
escowles authored and Andrew Woods committed Jul 24, 2014
1 parent a5a17ac commit 32110c8
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 5 deletions.
Expand Up @@ -89,6 +89,9 @@ public void initialize(final NamespaceRegistry registry,
if (!propertiesDirectory.exists() || !propertiesDirectory.isDirectory()) {
throw new RepositoryException("Configured \"propertiesDirectory\", " + propertiesDirectoryPath
+ ", does not exist or is not a directory.");
} else if ( !propertiesDirectory.canRead() || !propertiesDirectory.canWrite() ) {
throw new RepositoryException("Configured \"propertiesDirectory\", " + propertiesDirectoryPath
+ ", should be readable and writable.");
}
if (extraPropertiesStore() != null) {
LOGGER.warn("Extra properties store was specified but won't be used!");
Expand Down
Expand Up @@ -70,11 +70,14 @@ public void buildRepository() throws RepositoryException, IOException {

getPropertiesLoader().loadSystemProperties();

repository =
(JcrRepository) jcrRepositoryFactory
.getRepository(singletonMap(URL,
repositoryConfiguration.getURL()));

try {
repository = (JcrRepository) jcrRepositoryFactory.getRepository(
singletonMap(URL, repositoryConfiguration.getURL()));
} catch ( RepositoryException ex ) {
LOGGER.error("Error loading repository with configuration: {}",
((ClassPathResource) repositoryConfiguration).getPath());
throw ex;
}
}

@Override
Expand Down

0 comments on commit 32110c8

Please sign in to comment.