fix(sample-kmp): demonstrate throwing functions

This commit is contained in:
Harsh Shandilya 2023-09-12 01:55:58 +05:30
parent 9013544898
commit a24d5102bf
No known key found for this signature in database
1 changed files with 8 additions and 0 deletions

View File

@ -2,6 +2,9 @@ import dev.msfjarvis.tracelog.runtime.annotations.DebugLog
fun main() {
debuggableFunction("First parameter")
try {
throwingFunction()
} catch (_: Exception) {}
LogPrinter.printLogs()
}
@ -16,3 +19,8 @@ fun recordMessage(message: Any?) {
fun debuggableFunction(p0: String, p1: String = "Bar"): String {
return "Debugging is cool!"
}
@DebugLog
fun throwingFunction() {
throw Exception("This code is throwing!")
}