From 2ebc0a79e98760dca8935912d68eb65073563af2 Mon Sep 17 00:00:00 2001 From: Ryuji Eguchi Date: Wed, 29 Nov 2023 16:49:38 +1100 Subject: [PATCH 1/2] handle federated address lookup error --- app/lib/stellar/server_request_utils.ts | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/app/lib/stellar/server_request_utils.ts b/app/lib/stellar/server_request_utils.ts index de72cecc4..416e8ba59 100644 --- a/app/lib/stellar/server_request_utils.ts +++ b/app/lib/stellar/server_request_utils.ts @@ -10,7 +10,12 @@ import { tradeRspRecToPropsRec, transactionRspRecToPropsRec, } from './server_response_utils' -import { FederationServer, MuxedAccount, type ServerApi } from 'stellar-sdk' +import { + FederationServer, + MuxedAccount, + NotFoundError, + type ServerApi, +} from 'stellar-sdk' import type { CallBuilder } from 'stellar-sdk/lib/call_builder' import type { OperationCallBuilder } from 'stellar-sdk/lib/operation_call_builder' import type { EffectCallBuilder } from 'stellar-sdk/lib/effect_call_builder' @@ -123,6 +128,9 @@ const loadAccountByFederatedAddress = ( account: rsp.account, federatedAddress: address, })) + .catch((e) => { + throw new NotFoundError(e.message, undefined) + }) } const loadAccountByMuxedAddress = (server: HorizonServer, address: string) => { From 9ffd0412694829046ab5a172eb5d17e2cf87c47c Mon Sep 17 00:00:00 2001 From: Ryuji Eguchi Date: Thu, 30 Nov 2023 04:27:19 +1100 Subject: [PATCH 2/2] convert .eslintrc to .eslintrc.js --- .eslintrc | 28 ---------------------------- .eslintrc.js | 28 ++++++++++++++++++++++++++++ 2 files changed, 28 insertions(+), 28 deletions(-) delete mode 100644 .eslintrc create mode 100644 .eslintrc.js diff --git a/.eslintrc b/.eslintrc deleted file mode 100644 index 73b006810..000000000 --- a/.eslintrc +++ /dev/null @@ -1,28 +0,0 @@ -{ - "extends": [ - "@remix-run/eslint-config", - "@remix-run/eslint-config/jest-testing-library", - "react-app", - "prettier" - ], - "plugins": ["prettier"], - "overrides": [ - { - "files": ["*.ts", "*.tsx", "*.js"], - "parser": "@typescript-eslint/parser" - } - ], - "rules": { - "react/jsx-wrap-multilines": "off", - "jsx-a11y/anchor-has-content": "off", - "comma-dangle": ["warn", "always-multiline"], - "quotes": ["warn", "single"], - "semi": ["warn", "never"], - "prettier/prettier": [ - "error", - { - "singleQuote": true - } - ] - } -} diff --git a/.eslintrc.js b/.eslintrc.js new file mode 100644 index 000000000..de4c719fa --- /dev/null +++ b/.eslintrc.js @@ -0,0 +1,28 @@ +module.exports = { + extends: [ + '@remix-run/eslint-config', + '@remix-run/eslint-config/jest-testing-library', + 'react-app', + 'prettier', + ], + plugins: ['prettier'], + overrides: [ + { + files: ['*.ts', '*.tsx', '*.js'], + parser: '@typescript-eslint/parser', + }, + ], + rules: { + 'react/jsx-wrap-multilines': 'off', + 'jsx-a11y/anchor-has-content': 'off', + 'comma-dangle': ['warn', 'always-multiline'], + quotes: ['warn', 'single'], + semi: ['warn', 'never'], + 'prettier/prettier': [ + 'error', + { + singleQuote: true, + }, + ], + }, +}