Package-level declarations
Types
Functions
Non-fatal-only-catching version of stdlib's runCatching, directly returning a KmmResult -- Re-throws any fatal exceptions, such as OutOfMemoryError
. Re-implements Arrow's nonFatalOrThrow logic to avoid a dependency on Arrow for a single function.
Non-fatal-only-catching version of stdlib's runCatching, returning a Result -- Re-throws any fatal exceptions, such as OutOfMemoryError
. Re-implements Arrow's nonFatalOrThrow logic to avoid a dependency on Arrow for a single function.
Helper to effectively convert stdlib's runCatching to behave like KmmResult's Non-fatal-only catching. I.e. any fatal exceptions are thrown. The reason this exists is that catching incurs instantiation cost. This helper hence provides the best of both worlds.
Throws any fatal exceptions. This is a re-implementation taken from Arrow's nonFatalOrThrow
– to avoid a dependency on Arrow for a single function.
If the underlying Result is successful, returns it unchanged. If it failed, and the contained exception is of the specified type, returns it unchanged. Otherwise, wraps the contained exception in the specified type.