- this.videoService.getVideo(uuid).subscribe(
- video => {
- const startTime = this.route.snapshot.queryParams.start
- this.onVideoFetched(video, startTime)
- .catch(err => this.handleError(err))
- },
-
- error => {
- this.videoNotFound = true
- console.error(error)
- }
- )
+ this.videoService
+ .getVideo(uuid)
+ .pipe(catchError(err => this.restExtractor.redirectTo404IfNotFound(err, [ 400, 404 ])))
+ .subscribe(
+ video => {
+ const startTime = this.route.snapshot.queryParams.start
+ this.onVideoFetched(video, startTime)
+ .catch(err => this.handleError(err))
+ },
+
+ error => {
+ this.videoNotFound = true
+ console.error(error)
+ }
+ )