Created
June 18, 2021 02:18
-
-
Save CheolhoJeon/a7eff5c6e3201a8564b13b6ff85b6561 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package chap6.ExceptionHandling | |
import atomictest.capture | |
class Exception1( | |
val value: Int | |
): Exception("wrong value: $value") | |
open class Exception2( | |
description: String | |
): Exception(description) | |
class Exception3( | |
description: String | |
): Exception2(description) | |
fun main() { | |
capture { | |
throw Exception1(13) | |
} eq "Exception1: wrong value: 13" | |
capture { | |
throw Exception3("error") | |
} eq "Exception3: error" | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment