Skip to content

Commit 52a11e8

Browse files
committed
Changed brackets in custom 'capture' implementation
Because otherwise the automatic example checking system thinks that this example fails
1 parent 1831266 commit 52a11e8

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

Preventing Failure/Exception Handling/Examples/src/CaptureImplementation.kt

+2-2
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ fun capture(f: () -> Unit): CapturedException =
66
try { // [1]
77
f()
88
CapturedException(null, // [2]
9-
"[Error]: Expected an exception")
9+
"<Error>: Expected an exception")
1010
} catch (e: Throwable) { // [3]
1111
CapturedException(e::class,
1212
if (e.message != null) ": ${e.message}"
@@ -19,5 +19,5 @@ fun main() {
1919
} eq "Exception: !!!"
2020
capture {
2121
1
22-
} eq "[Error]: Expected an exception"
22+
} eq "<Error>: Expected an exception"
2323
}

0 commit comments

Comments
 (0)