Minor: better error message when the config file isn't found (#3460)

This commit is contained in:
Mike Hearn 2018-06-27 22:15:11 +02:00 committed by Michele Sollecito
parent e401eb604d
commit 4e52a957d1

View File

@ -2,6 +2,7 @@ package net.corda.node.internal
import com.jcabi.manifests.Manifests
import com.typesafe.config.Config
import com.typesafe.config.ConfigException
import com.typesafe.config.ConfigRenderOptions
import io.netty.channel.unix.Errors
import net.corda.core.crypto.Crypto
@ -106,8 +107,16 @@ open class NodeStartup(val args: Array<String>) {
} catch (e: UnknownConfigurationKeysException) {
logger.error(e.message)
return false
} catch (e: ConfigException.IO) {
println("""
Unable to load the node config file from '${cmdlineOptions.configFile}'.
Try experimenting with the --base-directory flag to change which directory the node
is looking in, or use the --config-file flag to specify it explicitly.
""".trimIndent())
return false
} catch (e: Exception) {
logger.error("Exception during node configuration", e)
logger.error("Unexpected error whilst reading node configuration", e)
return false
}
val errors = conf.validate()