Skip to content

Commit

Permalink
Throw exception
Browse files Browse the repository at this point in the history
  • Loading branch information
pipe01 committed Mar 23, 2024
1 parent 0be46fd commit f221aae
Showing 1 changed file with 1 addition and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -44,10 +44,7 @@ class WatchAdapter : ApiScriptableObject(WatchAdapter::class) {
field.isAccessible = true
field.get(time) as Double
}
else -> {
Context.throwAsScriptRuntimeEx(IllegalArgumentException("Invalid time"))
0.0
}
else -> throw Context.throwAsScriptRuntimeEx(IllegalArgumentException("Invalid time"))
}

val localTime = LocalDateTime.ofInstant(Instant.ofEpochMilli(timeMillis.toLong()), ZoneId.systemDefault())
Expand Down

0 comments on commit f221aae

Please sign in to comment.