mirror of
https://github.com/hansjone/netx.git
synced 2026-10-09 00:50:46 +08:00
fix(ume): accept empty JSON body on successful delete-subscription
Parse 204/empty UME responses without JSONDecodeError; improve request error messages and orphan-delete failure reporting. Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
parent
a8b359f60d
commit
635cd52d4f
3 changed files with 64 additions and 8 deletions
|
|
@ -162,7 +162,12 @@ def establish_alarm_subscription_manual(client: UMEClient, db: Session) -> dict[
|
|||
if not orphan_id:
|
||||
raise
|
||||
_ws_log.warning("establish: UME reports existing subscription id=%s, deleting then retry", orphan_id)
|
||||
_delete_subscription_on_ume(client, orphan_id)
|
||||
try:
|
||||
_delete_subscription_on_ume(client, orphan_id)
|
||||
except RuntimeError as del_exc:
|
||||
raise RuntimeError(
|
||||
f"ume_orphan_subscription_delete_failed:id={orphan_id}:{str(del_exc)[:180]}"
|
||||
) from del_exc
|
||||
sub_id, uri = client.establish_alarm_subscription(topic=topic)
|
||||
save_subscription(db, subscription_id=sub_id, wss_uri=uri, topic=topic)
|
||||
db.commit()
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue