This commit is contained in:
2024-08-18 13:03:24 +02:00
parent f69f7ae294
commit 6d648b9a71
11 changed files with 61 additions and 118 deletions
@@ -99,6 +99,7 @@ Message: ${cause.message}
}
"""
SWException.log(msg, cause.stackTraceToString())
call.response.headers.append("X-Caught", "1")
}
}
@@ -19,9 +19,11 @@
package de.steamwar.plugins
import de.steamwar.routes.catchException
import de.steamwar.sql.SteamwarUser
import io.ktor.server.request.*
import java.util.UUID
fun ApplicationRequest.getUser(key: String = "id"): SteamwarUser? {
return SteamwarUser.get(call.parameters[key]?.toIntOrNull() ?: return null)
return SteamwarUser.get(call.parameters[key]?.let { catchException { UUID.fromString(it) } } ?: return null)
}