You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
There are a few dozen cases where we try-catch exceptions, logging an error or debug message and returning a default value. Alternatively, we could use runCatching {}.onFailure(..) with a custom extensions on Result, like:
runCatching {
// do stuff
}.onFailureLogAndReturn("message", defaultValue)
Or if there's no return value:
runCatching {
// do stuff
}.onFailureLog("message")
log could log a DEBUG or ERROR Timber message depending on whether the error was a network exception or other "expected" exception.
There are a few dozen cases where we
try-catch
exceptions, logging an error or debug message and returning a default value. Alternatively, we could userunCatching {}.onFailure(..)
with a custom extensions onResult
, like:Or if there's no return value:
log
could log a DEBUG or ERROR Timber message depending on whether the error was a network exception or other "expected" exception.@shobhitagarwal1612 Wdyt?
The text was updated successfully, but these errors were encountered: