forked from TrueCloudLab/frostfs-node
[#1247] *: Clarify docs about returned errors from apistatus
package
`apistatus` package provides types which implement build-in `error` interface. Add `error of type` pattern when documenting these errors in order to clarify how these errors should be handled (e.g. `errors.Is` is not good). Signed-off-by: Leonard Lyubich <leonard@nspcc.ru>
This commit is contained in:
parent
459bdcf04b
commit
318639e5bf
24 changed files with 33 additions and 33 deletions
|
@ -21,7 +21,7 @@ type DeleteBigRes struct{}
|
|||
// Returns any error encountered that did not allow
|
||||
// to completely remove the object.
|
||||
//
|
||||
// Returns apistatus.ObjectNotFound if there is no object to delete.
|
||||
// Returns an error of type apistatus.ObjectNotFound if there is no object to delete.
|
||||
func (b *BlobStor) DeleteBig(prm *DeleteBigPrm) (*DeleteBigRes, error) {
|
||||
err := b.fsTree.Delete(prm.addr)
|
||||
if errors.Is(err, fstree.ErrFileNotFound) {
|
||||
|
|
|
@ -17,7 +17,7 @@ type DeleteSmallRes struct{}
|
|||
// Returns any error encountered that did not allow
|
||||
// to completely remove the object.
|
||||
//
|
||||
// Returns apistatus.ObjectNotFound if there is no object to delete.
|
||||
// Returns an error of type apistatus.ObjectNotFound if there is no object to delete.
|
||||
func (b *BlobStor) DeleteSmall(prm *DeleteSmallPrm) (*DeleteSmallRes, error) {
|
||||
return b.blobovniczas.delete(prm)
|
||||
}
|
||||
|
|
|
@ -24,7 +24,7 @@ type GetBigRes struct {
|
|||
// Returns any error encountered that
|
||||
// did not allow to completely read the object.
|
||||
//
|
||||
// Returns apistatus.ObjectNotFound if requested object is not
|
||||
// Returns an error of type apistatus.ObjectNotFound if requested object is not
|
||||
// presented in shallow dir.
|
||||
func (b *BlobStor) GetBig(prm *GetBigPrm) (*GetBigRes, error) {
|
||||
// get compressed object data
|
||||
|
|
|
@ -27,7 +27,7 @@ type GetRangeBigRes struct {
|
|||
// did not allow to completely read the object payload range.
|
||||
//
|
||||
// Returns ErrRangeOutOfBounds if requested object range is out of bounds.
|
||||
// Returns apistatus.ObjectNotFound if object is missing.
|
||||
// Returns an error of type apistatus.ObjectNotFound if object is missing.
|
||||
func (b *BlobStor) GetRangeBig(prm *GetRangeBigPrm) (*GetRangeBigRes, error) {
|
||||
// get compressed object data
|
||||
data, err := b.fsTree.Get(prm.addr)
|
||||
|
|
|
@ -21,7 +21,7 @@ type GetRangeSmallRes struct {
|
|||
// did not allow to completely read the object payload range.
|
||||
//
|
||||
// Returns ErrRangeOutOfBounds if requested object range is out of bounds.
|
||||
// Returns apistatus.ObjectNotFound if requested object is missing in blobovnicza(s).
|
||||
// Returns an error of type apistatus.ObjectNotFound if requested object is missing in blobovnicza(s).
|
||||
func (b *BlobStor) GetRangeSmall(prm *GetRangeSmallPrm) (*GetRangeSmallRes, error) {
|
||||
return b.blobovniczas.getRange(prm)
|
||||
}
|
||||
|
|
|
@ -19,7 +19,7 @@ type GetSmallRes struct {
|
|||
// Returns any error encountered that
|
||||
// did not allow to completely read the object.
|
||||
//
|
||||
// Returns apistatus.ObjectNotFound if requested object is missing in blobovnicza(s).
|
||||
// Returns an error of type apistatus.ObjectNotFound if requested object is missing in blobovnicza(s).
|
||||
func (b *BlobStor) GetSmall(prm *GetSmallPrm) (*GetSmallRes, error) {
|
||||
return b.blobovniczas.get(prm)
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue