mirror of
https://github.com/trezor/trezor-suite.git
synced 2026-03-03 05:55:03 +01:00
fix(suite): make the explorer build passing
This commit is contained in:
committed by
Tomáš Martykán
parent
8b952550ef
commit
3422038376
@@ -59,11 +59,11 @@ const rejectAfterMs = (ms: number, reason: Error, clear: AbortSignal) =>
|
||||
const maybeRejectAfterMs = (ms: number | undefined, reason: Error, clear: AbortSignal) =>
|
||||
ms === undefined ? [] : [rejectAfterMs(ms, reason, clear)];
|
||||
|
||||
export class RejectWhenAbortedError extends Error {
|
||||
static name = 'Aborted by signal';
|
||||
export const SCHEDULE_ACTION_ABORTED_ERROR_MESSAGE = 'Aborted by signal' as const;
|
||||
|
||||
export class RejectWhenAbortedError extends Error {
|
||||
constructor() {
|
||||
super(RejectWhenAbortedError.name);
|
||||
super(SCHEDULE_ACTION_ABORTED_ERROR_MESSAGE);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -123,17 +123,19 @@ const attemptLoop = async <T>(
|
||||
return clear.aborted ? Promise.reject() : attempt(attempts - 1, clear);
|
||||
};
|
||||
|
||||
export const SCHEDULE_ACTION_TIMEOUT_ERROR_MESSAGE = 'Aborted by timeout' as const;
|
||||
|
||||
export class ScheduleActionTimeoutError extends Error {
|
||||
static name = 'Aborted by timeout' as const;
|
||||
constructor() {
|
||||
super(ScheduleActionTimeoutError.name);
|
||||
super(SCHEDULE_ACTION_TIMEOUT_ERROR_MESSAGE);
|
||||
}
|
||||
}
|
||||
|
||||
export const SCHEDULE_ACTION_DEADLINE_ERROR_MESSAGE = 'Aborted by deadline' as const;
|
||||
|
||||
export class ScheduleActionDeadlineError extends Error {
|
||||
static name = 'Aborted by deadline' as const;
|
||||
constructor() {
|
||||
super(ScheduleActionDeadlineError.name);
|
||||
super(SCHEDULE_ACTION_DEADLINE_ERROR_MESSAGE);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -10,9 +10,9 @@ import type {
|
||||
} from '@suite-common/wallet-types';
|
||||
import TrezorConnect from '@trezor/connect';
|
||||
import {
|
||||
RejectWhenAbortedError,
|
||||
ScheduleActionDeadlineError,
|
||||
ScheduleActionTimeoutError,
|
||||
SCHEDULE_ACTION_ABORTED_ERROR_MESSAGE,
|
||||
SCHEDULE_ACTION_DEADLINE_ERROR_MESSAGE,
|
||||
SCHEDULE_ACTION_TIMEOUT_ERROR_MESSAGE,
|
||||
scheduleAction,
|
||||
} from '@trezor/utils';
|
||||
|
||||
@@ -55,9 +55,9 @@ const getConnectFiatRatesForTimestamp = async (
|
||||
if (
|
||||
('name' in error && error.name === 'AbortError') ||
|
||||
!('message' in error) ||
|
||||
(error.message !== ScheduleActionTimeoutError.name &&
|
||||
error.message !== ScheduleActionDeadlineError.name &&
|
||||
error.message !== RejectWhenAbortedError.name)
|
||||
(error.message !== SCHEDULE_ACTION_TIMEOUT_ERROR_MESSAGE &&
|
||||
error.message !== SCHEDULE_ACTION_DEADLINE_ERROR_MESSAGE &&
|
||||
error.message !== SCHEDULE_ACTION_ABORTED_ERROR_MESSAGE)
|
||||
) {
|
||||
throw error;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user