How to use the catchError function from rxjs
Find comprehensive JavaScript rxjs.catchError code examples handpicked from public code repositorys.
GitHub: openforis/sepal
39 40 41 42 43 44 45 46 47 48
else if (stream === 'stdout') log.debug(msg(`stdout\n${value}`)) else if (stream === 'stderr') log.warn(msg(`stderr\n${value}`)) }), catchError(error => { log.error(msg(error)) return throwError(() => new Error(`Failed to ${description}.`)) }) )
45
180
34
GitHub: openforis/sepal
113 114 115 116 117 118 119 120 121 122
log.debug(() => `${method} ${url} - ${status} (${ms}ms)`) } }) return request$.pipe( map(response => validateResponse(response, validStatuses)), catchError(e => { if (validStatuses && validStatuses.includes(e.statusCode)) { return of(e) } else { return throwError(() => e)
45
178
34
GitHub: openforis/sepal
107 108 109 110 111 112 113 114 115 116
? taskCompleted$(task.id) : progress.state === 'CANCELED' ? taskCanceled$(task.id) : of(progress) ), catchError(error => taskFailed$(task.id, error) ), // Prevent progress notification to Sepal more often than MIN_TIME_BETWEEN_NOTIFICATIONS millis // This is to prevent flooding Sepal with too many updates
45
177
0
+ 2 other calls in file
GitHub: VEGMQAZ/sepal
148 149 150 151 152 153 154 155 156 157
: exec$( path, 'sudo', ['GIT_TERMINAL_PROMPT=0', 'git', 'checkout', '-t', `origin/${branch}`] )), catchError(() => { log.warn(`Failed to checkout branch ${branch}: ${path}`) return of(false) }) )
45
0
0
+ 5 other calls in file
106 107 108 109 110 111 112 113 114 115
return from(RoasFacebook({ user_id }).ad.get_from_db({ ad_id })).pipe( concatMap(identity), rxfilter((ad) => !isEmpty(ad)), rxmap(Facebook.ad.details), defaultIfEmpty({}), catchError((error) => { console.log("Facebook:ad:db:get:error"); console.log(error); return rxof({ ad_id, error: true }); })
0
0
1
+ 5 other calls in file