[accelerator] proper error handling

This commit is contained in:
Mononaut committed 2024-07-05 10:42:46 +00:00
1 parent 20d948c280
commit b8820684c3
8 files changed
+132 -38

No files matched your search

@@ -1,2 +1,7 @@
<div class="alert" [class]="alertClass" [innerHTML]="errorContent">
</div>
@if (!textOnly) {
<div class="alert" [class]="alertClass" [innerHTML]="errorContent">
</div>
} @else {
<span [class]="alertClass" [innerHTML]="errorContent">
</span>
}
@@ -1,7 +1,7 @@
import { Component, Input, OnInit } from "@angular/core";
import { DomSanitizer, SafeHtml } from "@angular/platform-browser";
const MempoolErrors = {
export const MempoolErrors = {
'bad_request': `Your request was not valid. Please try again.`,
'internal_server_error': `Something went wrong, please try again later`,
'acceleration_duplicated': `This transaction has already been accelerated.`,
@@ -44,6 +44,7 @@ export function isMempoolError(error: string) {
export class MempoolErrorComponent implements OnInit {
@Input() error: string;
@Input() alertClass = 'alert-danger';
@Input() textOnly = false;
errorContent: SafeHtml;
constructor(private sanitizer: DomSanitizer) { }