fix(http): fix template not found error

pull/12868/head
Kelvin Wang 2019-03-25 12:03:39 -04:00
parent 36f2de831a
commit dac4167875
2 changed files with 10 additions and 0 deletions

View File

@ -4,6 +4,9 @@ import (
"context"
)
// ErrDocumentNotFound is the error msg for a missing document.
const ErrDocumentNotFound = "document not found"
// DocumentService is used to create/find instances of document stores.
type DocumentService interface {
CreateDocumentStore(ctx context.Context, name string) (DocumentStore, error)

View File

@ -581,6 +581,13 @@ func (s *DocumentStore) FindDocuments(ctx context.Context, opts ...influxdb.Docu
return nil
})
if IsNotFound(err) {
return nil, &influxdb.Error{
Code: influxdb.ENotFound,
Msg: influxdb.ErrDocumentNotFound,
}
}
if err != nil {
return nil, err
}