aboutsummaryrefslogtreecommitdiffhomepage
path: root/client/src/app/+video-channels/video-channels.component.ts
diff options
context:
space:
mode:
authorRigel Kent <sendmemail@rigelk.eu>2020-12-08 21:16:10 +0100
committerGitHub <noreply@github.com>2020-12-08 21:16:10 +0100
commitf2eb23cd87cf32b8fe545178143b5f49e06a58da (patch)
treeaf7d59945af70e28fd85047e2c688c59a908f548 /client/src/app/+video-channels/video-channels.component.ts
parentc977fd3ec931c059111ddb2b8d6ddbb20b6b99a1 (diff)
downloadPeerTube-f2eb23cd87cf32b8fe545178143b5f49e06a58da.tar.gz
PeerTube-f2eb23cd87cf32b8fe545178143b5f49e06a58da.tar.zst
PeerTube-f2eb23cd87cf32b8fe545178143b5f49e06a58da.zip
emit more specific status codes on video upload (#3423)
- reduce http status codes list to potentially useful codes - convert more codes to typed ones - factorize html generator for error responses
Diffstat (limited to 'client/src/app/+video-channels/video-channels.component.ts')
-rw-r--r--client/src/app/+video-channels/video-channels.component.ts6
1 files changed, 5 insertions, 1 deletions
diff --git a/client/src/app/+video-channels/video-channels.component.ts b/client/src/app/+video-channels/video-channels.component.ts
index ea8bda1cf..d2fd265c4 100644
--- a/client/src/app/+video-channels/video-channels.component.ts
+++ b/client/src/app/+video-channels/video-channels.component.ts
@@ -6,6 +6,7 @@ import { ActivatedRoute } from '@angular/router'
6import { AuthService, Notifier, RestExtractor, ScreenService } from '@app/core' 6import { AuthService, Notifier, RestExtractor, ScreenService } from '@app/core'
7import { ListOverflowItem, VideoChannel, VideoChannelService } from '@app/shared/shared-main' 7import { ListOverflowItem, VideoChannel, VideoChannelService } from '@app/shared/shared-main'
8import { SubscribeButtonComponent } from '@app/shared/shared-user-subscription' 8import { SubscribeButtonComponent } from '@app/shared/shared-user-subscription'
9import { HttpStatusCode } from '@shared/core-utils/miscs/http-error-codes'
9 10
10@Component({ 11@Component({
11 templateUrl: './video-channels.component.html', 12 templateUrl: './video-channels.component.html',
@@ -37,7 +38,10 @@ export class VideoChannelsComponent implements OnInit, OnDestroy {
37 map(params => params[ 'videoChannelName' ]), 38 map(params => params[ 'videoChannelName' ]),
38 distinctUntilChanged(), 39 distinctUntilChanged(),
39 switchMap(videoChannelName => this.videoChannelService.getVideoChannel(videoChannelName)), 40 switchMap(videoChannelName => this.videoChannelService.getVideoChannel(videoChannelName)),
40 catchError(err => this.restExtractor.redirectTo404IfNotFound(err, [ 400, 404 ])) 41 catchError(err => this.restExtractor.redirectTo404IfNotFound(err, [
42 HttpStatusCode.BAD_REQUEST_400,
43 HttpStatusCode.NOT_FOUND_404
44 ]))
41 ) 45 )
42 .subscribe(videoChannel => { 46 .subscribe(videoChannel => {
43 this.videoChannel = videoChannel 47 this.videoChannel = videoChannel