mirror of
https://github.com/NousResearch/hermes-agent.git
synced 2026-06-14 09:11:54 +00:00
Preserve Telegram onboarding fallback errors
This commit is contained in:
parent
ba29010902
commit
86e5efb0ae
2 changed files with 25 additions and 0 deletions
|
|
@ -3500,6 +3500,11 @@ def _telegram_onboarding_request_sync(
|
|||
status_code=502,
|
||||
detail="Telegram setup service is unavailable. Try again shortly.",
|
||||
) from exc
|
||||
except Exception as exc:
|
||||
raise HTTPException(
|
||||
status_code=502,
|
||||
detail="Telegram setup service is unavailable. Try again shortly.",
|
||||
) from exc
|
||||
|
||||
try:
|
||||
parsed = response.json()
|
||||
|
|
|
|||
|
|
@ -1182,6 +1182,26 @@ class TestWebServerEndpoints:
|
|||
assert kwargs["headers"]["Content-Type"] == "application/json"
|
||||
assert kwargs["headers"]["User-Agent"].startswith("HermesDashboard/")
|
||||
|
||||
def test_telegram_onboarding_worker_request_maps_unexpected_errors(
|
||||
self, monkeypatch
|
||||
):
|
||||
import hermes_cli.web_server as ws
|
||||
|
||||
monkeypatch.setenv("TELEGRAM_ONBOARDING_URL", "not a valid url")
|
||||
|
||||
with pytest.raises(ws.HTTPException) as exc:
|
||||
ws._telegram_onboarding_request_sync(
|
||||
"POST",
|
||||
"/v1/telegram/pairings",
|
||||
body={"bot_name": "Hermes Agent"},
|
||||
)
|
||||
|
||||
assert exc.value.status_code == 502
|
||||
assert (
|
||||
exc.value.detail
|
||||
== "Telegram setup service is unavailable. Try again shortly."
|
||||
)
|
||||
|
||||
def test_telegram_onboarding_start_strips_poll_token(self, monkeypatch):
|
||||
import hermes_cli.web_server as ws
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue