Skip to content
Snippets Groups Projects

Compare revisions

Changes are shown as if the source revision was being merged into the target revision. Learn more about comparing revisions.

Source

Select target project
No results found
Select Git revision

Target

Select target project
  • jonas.broeckmann/kaffeekasse
1 result
Select Git revision
Show changes
Commits on Source (2)
......@@ -11,7 +11,7 @@ image: eclipse-temurin:19-jdk-jammy
variables:
APP_VERSION: "1.2.3"
APP_VERSION: "1.2.4"
APP_APK: "kaffeekasse-${APP_VERSION}.apk"
PACKAGE_REGISTRY_URL: "${CI_API_V4_URL}/projects/${CI_PROJECT_ID}/packages/generic/kaffeekasse/${APP_VERSION}"
......
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="KotlinJpsPluginSettings">
<option name="version" value="2.0.0" />
<option name="version" value="2.0.10" />
</component>
</project>
\ No newline at end of file
......@@ -18,7 +18,7 @@ android {
minSdk = 26
targetSdk = 34
versionCode = 1
versionName = "1.2.3"
versionName = "1.2.4"
// Check that the version in environment matches the version in build.gradle.kts
System.getenv()["APP_VERSION"]?.let { versionFromEnv ->
......
......@@ -124,7 +124,7 @@ data class MonthDataResponse(
val secondsWorked: Int,
val holidays: Int,
@SerialName("last_reset")
val lastReset: String,
val lastReset: String?,
@SerialName("vacation_days")
val vacationDays: Int?,
@SerialName("hours_worked")
......
......@@ -43,6 +43,7 @@ import net.novagamestudios.kaffeekasse.api.portal.model.PortalAPIResponse
import net.novagamestudios.kaffeekasse.model.credentials.Login
import net.novagamestudios.kaffeekasse.model.credentials.isValid
import net.novagamestudios.kaffeekasse.util.MutableCookiesStorage
import net.novagamestudios.kaffeekasse.util.WrappedJsonSerializationException
class PortalClient(
coroutineScope: CoroutineScope
......@@ -72,7 +73,11 @@ class PortalClient(
}
}
internal inline fun <reified T> JsonElement.decodeAs() = jsonFormat.decodeFromJsonElement<T>(this)
internal inline fun <reified T> JsonElement.decodeAs() = try {
jsonFormat.decodeFromJsonElement<T>(this)
} catch (e: Exception) {
throw WrappedJsonSerializationException(e, this)
}
private val portal = object : Module(this, "portal") {
......
......@@ -112,6 +112,7 @@ import net.novagamestudios.kaffeekasse.ui.util.HorizontalPagedLayout
import net.novagamestudios.kaffeekasse.ui.util.KeyedPagerState
import net.novagamestudios.kaffeekasse.ui.util.onClickComingSoon
import net.novagamestudios.kaffeekasse.ui.util.synchronizePagerState
import net.novagamestudios.kaffeekasse.util.WrappedJsonSerializationException
import net.novagamestudios.kaffeekasse.util.richdata.RichData
import net.novagamestudios.kaffeekasse.util.richdata.RichDataState
import net.novagamestudios.kaffeekasse.util.richdata.collectAsRichStateHere
......@@ -297,6 +298,12 @@ fun Overview(
message = "Failed to fetch data",
Modifier.fillMaxSize(),
exceptions = data.exceptions,
additionalDetails = data.exceptions.mapNotNull { exception ->
when (exception) {
is WrappedJsonSerializationException -> exception.json
else -> null
}
},
onRetry = { model.refreshMonth(model.currentMonth) }
)
......
package net.novagamestudios.kaffeekasse.util
import kotlinx.serialization.json.JsonElement
open class WrappedJsonSerializationException(
message: String?,
cause: Throwable?,
val json: JsonElement
) : IllegalArgumentException(message, cause) {
constructor(e: Exception, json: JsonElement) : this(e.message, e, json)
}
\ No newline at end of file