fix(#74): mark unparseable cron expressions instead of silently returning raw

Co-authored-by: M57 <hy4ri@users.noreply.github.com>
This commit is contained in:
M57andM57 authored and GitHub committed 2026-06-19 20:52:44 +03:00
1 parent 11d97a2d5f
commit 6375e3fa1d
1 file changed
+6 -1
@@ -1,5 +1,7 @@
package com.m57.hermescontrol.util
import com.m57.hermescontrol.BuildConfig
object CronExpressionFormatter {
fun cronToHumanReadable(schedule: String): String {
val clean = schedule.trim().replace("\\s+".toRegex(), " ")
@@ -150,7 +152,10 @@ object CronExpressionFormatter {
// Fallback
return schedule
} catch (e: Exception) {
return schedule
if (BuildConfig.DEBUG) {
android.util.Log.w("CronExpressionFormatter", "Failed to parse cron: $schedule", e)
}
return "Raw: $schedule"
}
}