mirror of
https://github.com/corda/corda.git
synced 2025-04-09 04:15:35 +00:00
CORDA-3558: Allow initial registration errors to propagate up so the node exits with a failure code (#5899)
This commit is contained in:
parent
08925ee0a5
commit
e8d6701f87
@ -86,12 +86,10 @@ class InitialRegistration(val baseDirectory: Path, private val networkRootTrustS
|
||||
private fun initialRegistration(config: NodeConfiguration) {
|
||||
// Null checks for [compatibilityZoneURL], [rootTruststorePath] and
|
||||
// [rootTruststorePassword] have been done in [CmdLineOptions.loadConfig]
|
||||
val result = attempt { registerWithNetwork(config) }.doOnFailure(Consumer(this::handleRegistrationError))
|
||||
attempt { registerWithNetwork(config) }.doOnFailure(Consumer(this::handleRegistrationError)).getOrThrow()
|
||||
|
||||
if (result.isSuccess) {
|
||||
// At this point the node registration was successful. We can delete the marker file.
|
||||
deleteNodeRegistrationMarker(baseDirectory)
|
||||
}
|
||||
// At this point the node registration was successful. We can delete the marker file.
|
||||
deleteNodeRegistrationMarker(baseDirectory)
|
||||
}
|
||||
|
||||
private fun deleteNodeRegistrationMarker(baseDir: Path) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user