diff --git a/serverkeyapi/internal/api.go b/serverkeyapi/internal/api.go index ebba62b34..d560333ce 100644 --- a/serverkeyapi/internal/api.go +++ b/serverkeyapi/internal/api.go @@ -2,6 +2,7 @@ package internal import ( "context" + "fmt" "github.com/matrix-org/dendrite/internal/caching" "github.com/matrix-org/dendrite/internal/config" @@ -64,6 +65,10 @@ func (s *ServerKeyAPI) FetchKeys( } } } + // If we failed to fetch any keys then we should report an error. + if len(requests) > 0 { + return nil, fmt.Errorf("server key API failed to fetch %d keys", len(requests)) + } // Return the keys. return results, nil }