Browse Source

Better warning in logs when we fail to fetch an alias (#15922)

**Before:**
```
Error retrieving alias
```

**After:**
```
Error retrieving alias #foo:bar -> 401 Unauthorized
```

*Spawning from creating the [manual testing strategy for the outbound federation proxy](https://github.com/matrix-org/synapse/pull/15773).*
Eric Eastwood 10 months ago
parent
commit
ae391db777
2 changed files with 4 additions and 1 deletions
  1. 1 0
      changelog.d/15922.misc
  2. 3 1
      synapse/handlers/directory.py

+ 1 - 0
changelog.d/15922.misc

@@ -0,0 +1 @@
+Add details to warning in log when we fail to fetch an alias.

+ 3 - 1
synapse/handlers/directory.py

@@ -277,7 +277,9 @@ class DirectoryHandler:
             except RequestSendFailed:
                 raise SynapseError(502, "Failed to fetch alias")
             except CodeMessageException as e:
-                logging.warning("Error retrieving alias")
+                logging.warning(
+                    "Error retrieving alias %s -> %s %s", room_alias, e.code, e.msg
+                )
                 if e.code == 404:
                     fed_result = None
                 else: