diff --git a/frontend/src/app/components/address/address.component.html b/frontend/src/app/components/address/address.component.html index 836d52d5f..b0d4c73da 100644 --- a/frontend/src/app/components/address/address.component.html +++ b/frontend/src/app/components/address/address.component.html @@ -237,28 +237,29 @@
-
Error loading address data.
+ ({{ error | httpErrorMsg }}) +
+ @if (!officialMempoolSpace && (error.status === 413 || error.status === 405 || error.status === 504)) { +
There are too many transactions on this address, more than your backend can handle. See more on setting up a stronger backend.

Consider viewing this address on the official Mempool website instead:
-
- https://mempool.space/address/{{ addressString }} -
- http://mempoolhqx4isw62xs7abwphsq7ldayuidyx2v2oethdhhj6mlo2r6ad.onion/address/{{ addressString }} -

- ({{ error | httpErrorMsg }}) + } @else if (!officialMempoolSpace) { +
+ Consider viewing this address on the official Mempool website instead: + } + @if (!officialMempoolSpace) { +
+ https://mempool.space/address/{{ addressString }} +
+ http://mempoolhqx4isw62xs7abwphsq7ldayuidyx2v2oethdhhj6mlo2r6ad.onion/address/{{ addressString }} + }
-
- - - Error loading address data. - -
diff --git a/frontend/src/app/components/address/address.component.ts b/frontend/src/app/components/address/address.component.ts index 729a869da..e11d7cfa4 100644 --- a/frontend/src/app/components/address/address.component.ts +++ b/frontend/src/app/components/address/address.component.ts @@ -102,6 +102,7 @@ export class AddressComponent implements OnInit, OnDestroy { isMobile: boolean; showQR: boolean = false; + officialMempoolSpace = this.stateService.env.OFFICIAL_MEMPOOL_SPACE; address: Address; addressString: string; 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 540e284f1..19aa840e1 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 @@ -7,6 +7,7 @@ import { Pipe, PipeTransform } from '@angular/core'; }) export class HttpErrorPipe implements PipeTransform { transform(e: HttpErrorResponse | null): string { - return e ? `${e.status} ${e.statusText}: ${e.error}` : ''; + const errorMsg = typeof e.error === 'string' ? e.error : e.error?.error ?? ''; + return e ? `${e.status} ${e.statusText}: ${errorMsg}` : ''; } }