mirror of
https://gitlab.bixilon.de/bixilon/minosoft.git
synced 2025-09-15 18:34:56 -04:00
minosoft meeta: correctly throw error when (down)loading fails
See GH-20
This commit is contained in:
parent
ae7b15de10
commit
0cfb65b0c9
@ -31,12 +31,15 @@ object PreFlattening {
|
|||||||
|
|
||||||
val json: MutableJsonObject = synchronizedMapOf()
|
val json: MutableJsonObject = synchronizedMapOf()
|
||||||
|
|
||||||
val worker = UnconditionalWorker() // TODO: kutil 1.24 add error handler
|
var error: Throwable? = null
|
||||||
|
val worker = UnconditionalWorker(errorHandler = { if (error == null) error = it else it.printStackTrace() })
|
||||||
for ((type, data) in MinosoftMeta.root) {
|
for ((type, data) in MinosoftMeta.root) {
|
||||||
worker += add@{ json[type] = data.load(profile, version) ?: return@add }
|
worker += add@{ json[type] = data.load(profile, version) ?: return@add }
|
||||||
}
|
}
|
||||||
worker.work(latch)
|
worker.work(latch)
|
||||||
|
|
||||||
|
error?.let { throw it }
|
||||||
|
|
||||||
registries.load(version, json, latch)
|
registries.load(version, json, latch)
|
||||||
|
|
||||||
return registries
|
return registries
|
||||||
|
Loading…
x
Reference in New Issue
Block a user