- .catch(res => this.restExtractor.handleError(res))
- .subscribe(
- res => {
- this.clientId = res.client_id
- this.clientSecret = res.client_secret
- console.log('Client credentials loaded.')
- },
-
- error => {
- let errorMessage = error.message
-
- if (error.status === 403) {
- errorMessage = `Cannot retrieve OAuth Client credentials: ${error.text}. \n`
- errorMessage += 'Ensure you have correctly configured PeerTube (config/ directory), ' +
- 'in particular the "webserver" section.'
- }
-
- // We put a bigger timeout
- // This is an important message
- this.notificationsService.error('Error', errorMessage, { timeOut: 7000 })
- }
- )
+ .pipe(catchError(res => this.restExtractor.handleError(res)))
+ .subscribe(
+ res => {
+ this.clientId = res.client_id
+ this.clientSecret = res.client_secret
+ console.log('Client credentials loaded.')
+ },
+
+ error => {
+ let errorMessage = error.message
+
+ if (error.status === 403) {
+ errorMessage = `Cannot retrieve OAuth Client credentials: ${error.text}. \n`
+ errorMessage += 'Ensure you have correctly configured PeerTube (config/ directory), ' +
+ 'in particular the "webserver" section.'
+ }
+
+ // We put a bigger timeout
+ // This is an important message
+ this.notificationsService.error('Error', errorMessage, { timeOut: 7000 })
+ }
+ )