Type guard to check if a Result is a Failure.
The type of the error value.
The Result to check.
true if the result is a Failure, otherwise false.
true
false
import { Result } from '@praha/byethrow';const result: Result.Result<number, string> = { type: 'Failure', error: 'Something went wrong' };if (Result.isFailure(result)) { console.error(result.error); // Safe access to error} Copy
import { Result } from '@praha/byethrow';const result: Result.Result<number, string> = { type: 'Failure', error: 'Something went wrong' };if (Result.isFailure(result)) { console.error(result.error); // Safe access to error}
Type guard to check if a Result is a Failure.