mirror of
https://github.com/matrix-org/dendrite.git
synced 2025-12-20 21:33:19 -06:00
Return error if we failed to fetch some keys
This commit is contained in:
parent
483594b319
commit
d4db450f14
|
|
@ -2,6 +2,7 @@ package internal
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"context"
|
"context"
|
||||||
|
"fmt"
|
||||||
|
|
||||||
"github.com/matrix-org/dendrite/internal/caching"
|
"github.com/matrix-org/dendrite/internal/caching"
|
||||||
"github.com/matrix-org/dendrite/internal/config"
|
"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 the keys.
|
||||||
return results, nil
|
return results, nil
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue