summary refs log tree commit diff
diff options
context:
space:
mode:
authorEric Eastwood <erice@element.io>2023-07-11 17:12:41 -0500
committerGitHub <noreply@github.com>2023-07-11 17:12:41 -0500
commitae391db777af0146ad8b50fa5bcbd7cc39c0d886 (patch)
tree5fcff2d0626072bca16b12f2ca47044db6ab9a36
parentBump Unix sockets intro version (#15924) (diff)
downloadsynapse-ae391db777af0146ad8b50fa5bcbd7cc39c0d886.tar.xz
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).*
-rw-r--r--changelog.d/15922.misc1
-rw-r--r--synapse/handlers/directory.py4
2 files changed, 4 insertions, 1 deletions
diff --git a/changelog.d/15922.misc b/changelog.d/15922.misc
new file mode 100644
index 0000000000..93fc644877
--- /dev/null
+++ b/changelog.d/15922.misc
@@ -0,0 +1 @@
+Add details to warning in log when we fail to fetch an alias.
diff --git a/synapse/handlers/directory.py b/synapse/handlers/directory.py
index 1e0623c7f8..623a4e7b1d 100644
--- a/synapse/handlers/directory.py
+++ b/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: