From 1f04d35d66f2b98281f62a4906b462d9acbbcb26 Mon Sep 17 00:00:00 2001 From: Evgeny Taktarov Date: Fri, 28 Jun 2024 12:07:23 +0700 Subject: [PATCH] feat: support 422 error for rewards --- .../errorBlocks/ErrorUnprocessable.tsx | 22 +++++++++++++++++++ .../RewardsListErrorMessage.tsx | 5 +++++ 2 files changed, 27 insertions(+) create mode 100644 features/rewards/components/errorBlocks/ErrorUnprocessable.tsx diff --git a/features/rewards/components/errorBlocks/ErrorUnprocessable.tsx b/features/rewards/components/errorBlocks/ErrorUnprocessable.tsx new file mode 100644 index 000000000..0389ea1fa --- /dev/null +++ b/features/rewards/components/errorBlocks/ErrorUnprocessable.tsx @@ -0,0 +1,22 @@ +import Link from 'next/link'; +import { ErrorBlockBase } from './ErrorBlockBase'; + +export const ErrorUnprocessable = () => ( + + This address has too many stETH transfers. For querying such addresses + use{' '} + + Rewards Module from Lido Ethereum SDK + {' '} + and fetch rewards from subgraph directly + + } + /> +); diff --git a/features/rewards/components/rewardsListContent/RewardsListErrorMessage.tsx b/features/rewards/components/rewardsListContent/RewardsListErrorMessage.tsx index 95cea358a..d03076d56 100644 --- a/features/rewards/components/rewardsListContent/RewardsListErrorMessage.tsx +++ b/features/rewards/components/rewardsListContent/RewardsListErrorMessage.tsx @@ -4,6 +4,7 @@ import { ErrorRateLimited } from '../errorBlocks/ErrorRateLimited'; import { extractErrorMessage } from 'utils'; import { FetcherError } from 'utils/fetcherError'; +import { ErrorUnprocessable } from '../errorBlocks/ErrorUnprocessable'; type Props = { error: unknown; @@ -20,5 +21,9 @@ export const RewardsListErrorMessage: React.FC = ({ error }) => { return ; } + if (error instanceof FetcherError && error.status === 422) { + return ; + } + return ; };