mirror of
https://github.com/corda/corda.git
synced 2025-01-31 08:25:50 +00:00
Minor: better error message when the config file isn't found (#3460)
This commit is contained in:
parent
e401eb604d
commit
4e52a957d1
@ -2,6 +2,7 @@ package net.corda.node.internal
|
|||||||
|
|
||||||
import com.jcabi.manifests.Manifests
|
import com.jcabi.manifests.Manifests
|
||||||
import com.typesafe.config.Config
|
import com.typesafe.config.Config
|
||||||
|
import com.typesafe.config.ConfigException
|
||||||
import com.typesafe.config.ConfigRenderOptions
|
import com.typesafe.config.ConfigRenderOptions
|
||||||
import io.netty.channel.unix.Errors
|
import io.netty.channel.unix.Errors
|
||||||
import net.corda.core.crypto.Crypto
|
import net.corda.core.crypto.Crypto
|
||||||
@ -106,8 +107,16 @@ open class NodeStartup(val args: Array<String>) {
|
|||||||
} catch (e: UnknownConfigurationKeysException) {
|
} catch (e: UnknownConfigurationKeysException) {
|
||||||
logger.error(e.message)
|
logger.error(e.message)
|
||||||
return false
|
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) {
|
} catch (e: Exception) {
|
||||||
logger.error("Exception during node configuration", e)
|
logger.error("Unexpected error whilst reading node configuration", e)
|
||||||
return false
|
return false
|
||||||
}
|
}
|
||||||
val errors = conf.validate()
|
val errors = conf.validate()
|
||||||
|
Loading…
x
Reference in New Issue
Block a user