@@ -459,4 +459,11 @@
|
+
+
+
+
+
+ Error loading pool data.
+
\ No newline at end of file
diff --git a/frontend/src/app/components/pool/pool.component.ts b/frontend/src/app/components/pool/pool.component.ts
index 2648bc4ca..6564a5dd9 100644
--- a/frontend/src/app/components/pool/pool.component.ts
+++ b/frontend/src/app/components/pool/pool.component.ts
@@ -9,6 +9,7 @@ import { StateService } from '../../services/state.service';
import { selectPowerOfTen } from '../../bitcoin.utils';
import { formatNumber } from '@angular/common';
import { SeoService } from '../../services/seo.service';
+import { HttpErrorResponse } from '@angular/common/http';
interface AccelerationTotal {
cost: number,
@@ -33,6 +34,7 @@ export class PoolComponent implements OnInit {
blocks$: Observable
;
oobFees$: Observable;
isLoading = true;
+ error: HttpErrorResponse | null = null;
chartOptions: EChartsOption = {};
chartInitOptions = {
@@ -105,6 +107,10 @@ export class PoolComponent implements OnInit {
}
return this.apiService.getPoolBlocks$(this.slug, this.blocks[this.blocks.length - 1]?.height);
}),
+ catchError((err) => {
+ this.error = err;
+ return of([]);
+ }),
tap((newBlocks) => {
this.blocks = this.blocks.concat(newBlocks);
}),
diff --git a/frontend/src/app/shared/pipes/http-error-pipe/http-error.pipe.ts b/frontend/src/app/shared/pipes/http-error-pipe/http-error.pipe.ts
index 3cbb16df6..51e9c4c0b 100644
--- a/frontend/src/app/shared/pipes/http-error-pipe/http-error.pipe.ts
+++ b/frontend/src/app/shared/pipes/http-error-pipe/http-error.pipe.ts
@@ -4,6 +4,6 @@ import { Pipe, PipeTransform } from '@angular/core';
@Pipe({ name: 'httpErrorMsg' })
export class HttpErrorPipe implements PipeTransform {
transform(e: HttpErrorResponse | null): string {
- return e ? `${e.status}: ${e.statusText}` : '';
+ return e ? `${e.status} ${e.statusText}: ${e.error}` : '';
}
}