forked from TrueCloudLab/frostfs-node
[#108] object/head: Return 404 error if header was not found
Define ErrNotFound error in headsvc package. Return ErrNotFound from Head method if the header was not found in the container. Signed-off-by: Leonard Lyubich <leonard@nspcc.ru>
This commit is contained in:
parent
ae0dd9e051
commit
5ad0df7794
2 changed files with 3 additions and 1 deletions
|
@ -135,7 +135,7 @@ loop:
|
|||
}
|
||||
|
||||
if !h.traverser.Success() {
|
||||
return nil, errors.Errorf("(%T) incomplete object Head operation", h)
|
||||
return nil, errors.Wrapf(ErrNotFound, "(%T) incomplete object Head operation", h)
|
||||
}
|
||||
|
||||
return resp, nil
|
||||
|
|
|
@ -39,6 +39,8 @@ type cfg struct {
|
|||
rightChildSearcher RelationSearcher
|
||||
}
|
||||
|
||||
var ErrNotFound = errors.New("object header not found")
|
||||
|
||||
func defaultCfg() *cfg {
|
||||
return &cfg{
|
||||
workerPool: new(util.SyncWorkerPool),
|
||||
|
|
Loading…
Reference in a new issue