Better error handling for invalid server
This commit is contained in:
parent
5004de35e1
commit
de0145a6c6
|
@ -15,7 +15,7 @@ class Config(rawConfig: RawConfig) {
|
||||||
|
|
||||||
init {
|
init {
|
||||||
Globals.systemConfig = system
|
Globals.systemConfig = system
|
||||||
Globals.server = api.getServerById(system.serverId).orElseThrow()
|
Globals.server = api.getServerById(system.serverId).orElseThrow { IllegalArgumentException("Invalid server configured.") }
|
||||||
Globals.features = rawConfig.features?.let(::Features) ?: Features(RawFeatures(null))
|
Globals.features = rawConfig.features?.let(::Features) ?: Features(RawFeatures(null))
|
||||||
// TODO: remove this
|
// TODO: remove this
|
||||||
this.features = Globals.features
|
this.features = Globals.features
|
||||||
|
|
Loading…
Reference in New Issue
Block a user