diff options
author | maxberger <max@berger.name> | 2023-08-03 09:26:42 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-08-03 09:26:42 +0200 |
commit | 294eff8a7f42f11b3559ca941468c766358fcae1 (patch) | |
tree | da4138d23423f2195726d8d33207651e26dd88b1 /appservice | |
parent | c7193e24d06a549b2e4a3bfca2d6e0f6c62d5f80 (diff) |
Add ID in error messages for ApplicationServices (#3162)
This is to easier identify which service caused the error.
Feature is just improving logging, thus no tests added.
### Pull Request Checklist
<!-- Please read
https://matrix-org.github.io/dendrite/development/contributing before
submitting your pull request -->
* [X] I have justified why this PR doesn't need tests
* [X] Pull request includes a [sign off below using a legally
identifiable
name](https://matrix-org.github.io/dendrite/development/contributing#sign-off)
_or_ I have already signed off privately
Signed-off-by: `Maximilian Berger <max@berger.name>`
Co-authored-by: Till <2353100+S7evinK@users.noreply.github.com>
Diffstat (limited to 'appservice')
-rw-r--r-- | appservice/query/query.go | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/appservice/query/query.go b/appservice/query/query.go index ca8d7b3a..5c736f37 100644 --- a/appservice/query/query.go +++ b/appservice/query/query.go @@ -217,7 +217,7 @@ func (a *AppServiceQueryAPI) Locations( } if err := requestDo[[]api.ASLocationResponse](as.HTTPClient, url+"?"+params.Encode(), &asLocations); err != nil { - log.WithError(err).Error("unable to get 'locations' from application service") + log.WithError(err).WithField("application_service", as.ID).Error("unable to get 'locations' from application service") continue } @@ -252,7 +252,7 @@ func (a *AppServiceQueryAPI) User( } if err := requestDo[[]api.ASUserResponse](as.HTTPClient, url+"?"+params.Encode(), &asUsers); err != nil { - log.WithError(err).Error("unable to get 'user' from application service") + log.WithError(err).WithField("application_service", as.ID).Error("unable to get 'user' from application service") continue } @@ -290,7 +290,7 @@ func (a *AppServiceQueryAPI) Protocols( for _, as := range a.Cfg.Derived.ApplicationServices { var proto api.ASProtocolResponse if err := requestDo[api.ASProtocolResponse](as.HTTPClient, as.RequestUrl()+api.ASProtocolPath+req.Protocol, &proto); err != nil { - log.WithError(err).Error("unable to get 'protocol' from application service") + log.WithError(err).WithField("application_service", as.ID).Error("unable to get 'protocol' from application service") continue } @@ -320,7 +320,7 @@ func (a *AppServiceQueryAPI) Protocols( for _, p := range as.Protocols { var proto api.ASProtocolResponse if err := requestDo[api.ASProtocolResponse](as.HTTPClient, as.RequestUrl()+api.ASProtocolPath+p, &proto); err != nil { - log.WithError(err).Error("unable to get 'protocol' from application service") + log.WithError(err).WithField("application_service", as.ID).Error("unable to get 'protocol' from application service") continue } existing, ok := response[p] |