diff options
author | Rigel Kent <sendmemail@rigelk.eu> | 2020-12-08 21:16:10 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-12-08 21:16:10 +0100 |
commit | f2eb23cd87cf32b8fe545178143b5f49e06a58da (patch) | |
tree | af7d59945af70e28fd85047e2c688c59a908f548 /client/src/app/+video-channels | |
parent | c977fd3ec931c059111ddb2b8d6ddbb20b6b99a1 (diff) | |
download | PeerTube-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')
-rw-r--r-- | client/src/app/+video-channels/video-channels.component.ts | 6 |
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' | |||
6 | import { AuthService, Notifier, RestExtractor, ScreenService } from '@app/core' | 6 | import { AuthService, Notifier, RestExtractor, ScreenService } from '@app/core' |
7 | import { ListOverflowItem, VideoChannel, VideoChannelService } from '@app/shared/shared-main' | 7 | import { ListOverflowItem, VideoChannel, VideoChannelService } from '@app/shared/shared-main' |
8 | import { SubscribeButtonComponent } from '@app/shared/shared-user-subscription' | 8 | import { SubscribeButtonComponent } from '@app/shared/shared-user-subscription' |
9 | import { 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 |