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).*
This commit is contained in:
Eric Eastwood 2023-07-11 17:12:41 -05:00 committed by GitHub
parent d7fc87d973
commit ae391db777
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 4 additions and 1 deletions

1
changelog.d/15922.misc Normal file
View File

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

View File

@ -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: