Add some 404s
This commit is contained in:
@ -12,6 +12,8 @@ import (
|
||||
"github.com/rickb777/date"
|
||||
)
|
||||
|
||||
var ErrNotFound = errors.New("not found")
|
||||
|
||||
type GenString func(length int) (string, error)
|
||||
|
||||
type Store struct {
|
||||
@ -211,8 +213,7 @@ func (s *Store) GetEventMetadata(ctx context.Context, query GetEventMetadataQuer
|
||||
return GetEventMetadataResult{}, err
|
||||
}
|
||||
if !found {
|
||||
// TODO return a constant or a specific error type for Not Found
|
||||
return GetEventMetadataResult{}, errors.New("not found")
|
||||
return GetEventMetadataResult{}, ErrNotFound
|
||||
}
|
||||
return result, nil
|
||||
}
|
||||
@ -246,7 +247,7 @@ func (s *Store) GetEventResponseSummary(ctx context.Context, query GetEventRespo
|
||||
return GetEventResponseSummaryResult{}, err
|
||||
}
|
||||
if !found {
|
||||
return GetEventResponseSummaryResult{}, errors.New("event not found")
|
||||
return GetEventResponseSummaryResult{}, ErrNotFound
|
||||
}
|
||||
|
||||
var result GetEventResponseSummaryResult
|
||||
@ -351,8 +352,7 @@ func (s *Store) GetEventResponse(ctx context.Context, query GetEventResponseQuer
|
||||
return GetEventResponseResult{}, err
|
||||
}
|
||||
if !found {
|
||||
// TODO return a constant or typed error
|
||||
return GetEventResponseResult{}, errors.New("not found")
|
||||
return GetEventResponseResult{}, ErrNotFound
|
||||
}
|
||||
|
||||
result.DateHours = make(map[date.Date]map[int]struct{})
|
||||
|
Reference in New Issue
Block a user