Rework error handling to be more robust

This commit is contained in:
comp500
2020-12-15 17:28:23 +00:00
parent 1d4c94f5b6
commit 0858c90079
10 changed files with 170 additions and 115 deletions

View File

@@ -14,6 +14,7 @@ object HandlerManager {
RequestHandlerFile()
)
// TODO: get rid of nullable stuff here
@JvmStatic
fun getNewLoc(base: SpaceSafeURI?, loc: SpaceSafeURI?): SpaceSafeURI? {
if (loc == null) {
@@ -32,6 +33,8 @@ object HandlerManager {
// Zip handler discards once read, requesting multiple times on other handlers would cause multiple downloads
// Caching system? Copy from already downloaded files?
// TODO: change to use something more idiomatic than exceptions?
@JvmStatic
@Throws(Exception::class)
fun getFileSource(loc: SpaceSafeURI): Source {