Skip to content

Commit 1b8ad3c

Browse files
Retengartmissytake
authored andcommitted
fix: handle turn_credentials exceptions in metadata proxy
ConnectionRefusedError/FileNotFoundError/TimeoutError from turn_credentials() would kill the dict proxy connection. Return N (not found) response instead and log the error.
1 parent f85d304 commit 1b8ad3c

1 file changed

Lines changed: 5 additions & 1 deletion

File tree

chatmaild/src/chatmaild/metadata.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,11 @@ def handle_lookup(self, parts):
101101
# Handle `GETMETADATA "" /shared/vendor/deltachat/irohrelay`
102102
return f"O{self.iroh_relay}\n"
103103
elif keyname == "vendor/vendor.dovecot/pvt/server/vendor/deltachat/turn":
104-
res = turn_credentials()
104+
try:
105+
res = turn_credentials()
106+
except Exception:
107+
logging.exception("failed to get TURN credentials")
108+
return "N\n"
105109
port = 3478
106110
return f"O{self.turn_hostname}:{port}:{res}\n"
107111

0 commit comments

Comments
 (0)