import {of} from 'rxjs' import {catchError, map} from 'rxjs/operators' export const makeFailure = () => of({}) .pipe(map(() => ({success: false, value: 'Trail does not exist'}))) .pipe(catchError(error => of({success: false, value: error.response})))