@@ -18,9 +18,10 @@ import {PageEnvService} from '@services/page-env.service';
18
18
import { APIPicture , PictureService } from '@services/picture' ;
19
19
import { getCatalogueSectionsTranslation } from '@utils/translations' ;
20
20
import { combineLatest , EMPTY , Observable , of } from 'rxjs' ;
21
- import { debounceTime , distinctUntilChanged , map , shareReplay , switchMap , tap } from 'rxjs/operators' ;
21
+ import { catchError , debounceTime , distinctUntilChanged , map , shareReplay , switchMap , tap } from 'rxjs/operators' ;
22
22
23
23
import { chunk , chunkBy } from '../../chunk' ;
24
+ import { ToastsService } from '../../toasts/toasts.service' ;
24
25
import { CatalogueService } from '../catalogue-service' ;
25
26
26
27
interface APIBrandSectionGroup {
@@ -90,6 +91,10 @@ export class CatalogueIndexComponent {
90
91
} ) ,
91
92
) ;
92
93
} ) ,
94
+ catchError ( ( response : unknown ) => {
95
+ this . toastService . handleError ( response ) ;
96
+ return EMPTY ;
97
+ } ) ,
93
98
switchMap ( ( response ) => {
94
99
if ( ! response . items || response . items . length <= 0 ) {
95
100
this . router . navigate ( [ '/error-404' ] , {
@@ -188,5 +193,6 @@ export class CatalogueIndexComponent {
188
193
private readonly catalogue : CatalogueService ,
189
194
private readonly itemsClient : ItemsClient ,
190
195
private readonly languageService : LanguageService ,
196
+ private readonly toastService : ToastsService ,
191
197
) { }
192
198
}
0 commit comments