isFailed
Checks if this object represents a failed operation.
This extension function provides a convenient way to check if any object is an ErrorInfo instance that represents a failure (not successful). Returns false for null objects or successful ErrorInfo instances.
Receiver
Any object that might be an ErrorInfo
Return
true if this is a failed ErrorInfo, false otherwise
val result = someOperation()
if (result.isFailed()) {
handleError(result as ErrorInfo)
}Content copied to clipboard