Merge pull request #5068 from mempool/mononaut/handle-services-outage

Fix error handling for non-critical services API requests
This commit is contained in:
softsimon
2024-05-13 10:03:13 +07:00
committed by GitHub
2 changed files with 12 additions and 2 deletions

View File

@@ -136,7 +136,12 @@ export class BlockPreviewComponent implements OnInit, OnDestroy {
return of(transactions); return of(transactions);
}) })
), ),
this.stateService.env.ACCELERATOR === true && block.height > 819500 ? this.servicesApiService.getAccelerationHistory$({ blockHeight: block.height }) : of([]) this.stateService.env.ACCELERATOR === true && block.height > 819500
? this.servicesApiService.getAccelerationHistory$({ blockHeight: block.height })
.pipe(catchError(() => {
return of([]);
}))
: of([])
]); ]);
} }
), ),

View File

@@ -345,7 +345,12 @@ export class BlockComponent implements OnInit, OnDestroy {
return of(null); return of(null);
}) })
), ),
this.stateService.env.ACCELERATOR === true && block.height > 819500 ? this.servicesApiService.getAccelerationHistory$({ blockHeight: block.height }) : of([]) this.stateService.env.ACCELERATOR === true && block.height > 819500
? this.servicesApiService.getAccelerationHistory$({ blockHeight: block.height })
.pipe(catchError(() => {
return of([]);
}))
: of([])
]); ]);
}) })
) )