mirror of
https://github.com/corda/corda.git
synced 2025-01-29 15:43:55 +00:00
ENT-4368 - Improve error handling when required included config resource cannot be found. Add note in docs encouraging use of required syntax for includes. (#5907)
This commit is contained in:
parent
5b186b1c65
commit
286fffd67a
@ -36,6 +36,10 @@ This prevents configuration errors when mixing keys containing ``.`` wrapped wit
|
||||
By default the node will fail to start in presence of unknown property keys.
|
||||
To alter this behaviour, the ``on-unknown-config-keys`` command-line argument can be set to ``IGNORE`` (default is ``FAIL``).
|
||||
|
||||
.. note:: As noted in the HOCON documentation, the default behaviour for resources referenced within a config file is to silently
|
||||
ignore them if missing. Therefore it is strongly recommended to utilise the ``required`` syntax for includes. See HOCON documentation
|
||||
for more information.
|
||||
|
||||
Overriding configuration values
|
||||
-------------------------------
|
||||
|
||||
|
@ -74,15 +74,16 @@ open class SharedNodeCmdLineOptions {
|
||||
}
|
||||
errors.forEach { error ->
|
||||
when (error) {
|
||||
is ConfigException.IO -> logger.error(configFileNotFoundMessage(configFile))
|
||||
is ConfigException.IO -> logger.error(configFileNotFoundMessage(configFile, error.cause))
|
||||
else -> logger.error(error.message)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private fun configFileNotFoundMessage(configFile: Path): String {
|
||||
private fun configFileNotFoundMessage(configFile: Path, cause: Throwable?): String {
|
||||
return """
|
||||
Unable to load the node config file from '$configFile'.
|
||||
${cause?.message?.let { "Cause: $it" } ?: ""}
|
||||
|
||||
Try setting the --base-directory flag to change which directory the node
|
||||
is looking in, or use the --config-file flag to specify it explicitly.
|
||||
|
Loading…
x
Reference in New Issue
Block a user