Force the returned value in test.catch() and test.catchOrNull() (#1910)

This commit is contained in:
Aagam Shah authored and GitHub committed 2026-10-16 12:02:33 -07:00
1 parent 9f79fe47da
commit e18d962033
5 files changed
+40 -4

No files matched your search

+4
View File
@@ -88,10 +88,14 @@ examples: Mapping<String, Listing<unknown>>?
/// Applies [fun] and returns the error thrown.
///
/// The value returned by [fun] is fully evaluated, so an error inside a nested object member will be caught too.
///
/// Throws if [fun] did not throw an error.
external const function catch(fun: () -> Any): String
/// Applies [fun] and returns the error thrown.
///
/// The value returned by [fun] is fully evaluated, so an error inside a nested object member will be caught too.
///
/// Returns [null] if [fun] did not throw an error.
external const function catchOrNull(fun: () -> Any): String?