Read the published research corpus and avoid expensive paging plans [skip ci]
This commit is contained in:
@@ -100,6 +100,11 @@ func TestQueryDefaultsAndUnicode(t *testing.T) {
|
||||
}
|
||||
}
|
||||
|
||||
type databaseFailure string
|
||||
|
||||
func (failure databaseFailure) Error() string { return "private database error" }
|
||||
func (failure databaseFailure) SQLState() string { return string(failure) }
|
||||
|
||||
func TestStorageErrorsAreRedacted(t *testing.T) {
|
||||
for _, test := range []struct {
|
||||
err error
|
||||
@@ -108,6 +113,8 @@ func TestStorageErrorsAreRedacted(t *testing.T) {
|
||||
}{
|
||||
{sql.ErrNoRows, 404, "not_found"},
|
||||
{context.DeadlineExceeded, 504, "research_timeout"},
|
||||
{errors.Join(databaseFailure("57014"), errors.New("private statement")), 504, "research_timeout"},
|
||||
{databaseFailure("42501"), 503, "research_unavailable"},
|
||||
{errors.New("postgres://private-user:private-password@db/corpus"), 503, "research_unavailable"},
|
||||
} {
|
||||
mux := http.NewServeMux()
|
||||
|
||||
Reference in New Issue
Block a user