Skip to content

Commit c8e56b7

Browse files
authored
feat(ui):Update API connection failed error message (#567)
## 📝 Pull Request Template ### 1. Related Issue Closes # (issue number) ### 2. Type of Change (select one) other ### 3. Description updated the error message displayed when an API connection fails to be more descriptive and helpful to users. ### 4. Testing - [x] I have tested this locally. - [x] I have updated or added relevant tests. ### 5. Checklist - [x] I have read the [Code of Conduct](./CODE_OF_CONDUCT.md) - [x] I have followed the [Contributing Guidelines](./CONTRIBUTING.md) - [x] My changes follow the project's coding style --------- Co-authored-by: MXD66 <239960619+MXD66@users.noreply.github.com>
1 parent 38dd2ec commit c8e56b7

File tree

2 files changed

+13
-3
lines changed

2 files changed

+13
-3
lines changed

frontend/src/components/valuecell/form/exchange-form.tsx

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -128,7 +128,9 @@ export const ExchangeForm = withForm({
128128
} catch (_error) {
129129
setTestStatus({
130130
success: false,
131-
message: "Failed, please check your API key",
131+
message:
132+
"Connection failed. Please check your API Key, Secret Key, or " +
133+
"Passphrase.",
132134
});
133135
}
134136
};

python/valuecell/server/api/routers/strategy_agent.py

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -282,7 +282,11 @@ async def test_exchange_connection(request: ExchangeConfig):
282282
# But SuccessResponse implies 200.
283283
# If I raise HTTPException it shows as error.
284284
raise HTTPException(
285-
status_code=400, detail="Failed, please check your API key"
285+
status_code=400,
286+
detail=(
287+
"Connection failed. Please check your API Key, "
288+
"Secret Key, or Passphrase."
289+
),
286290
)
287291
finally:
288292
await gateway.close()
@@ -291,7 +295,11 @@ async def test_exchange_connection(request: ExchangeConfig):
291295
# If create_ccxt_gateway fails or other error, avoid logging sensitive info
292296
logger.warning("Connection test failed")
293297
raise HTTPException(
294-
status_code=400, detail="Failed, please check your API key"
298+
status_code=400,
299+
detail=(
300+
"Connection failed. Please check your API Key, "
301+
"Secret Key, or Passphrase."
302+
),
295303
)
296304

297305
@router.delete("/delete")

0 commit comments

Comments
 (0)