From fcfae52feb2a2091c67ba694ea379d8079441d42 Mon Sep 17 00:00:00 2001 From: David Christofas Date: Tue, 3 Nov 2020 13:18:59 +0100 Subject: [PATCH] fix error type in ReadNode when file was not found The method ReadNode in the ocis storage didn't return the error type NotFound when a file was not found. Signed-off-by: David Christofas --- changelog/unreleased/readnode-error-type.md | 6 ++++++ pkg/storage/fs/ocis/node.go | 2 +- 2 files changed, 7 insertions(+), 1 deletion(-) create mode 100644 changelog/unreleased/readnode-error-type.md diff --git a/changelog/unreleased/readnode-error-type.md b/changelog/unreleased/readnode-error-type.md new file mode 100644 index 00000000000..905c256a86c --- /dev/null +++ b/changelog/unreleased/readnode-error-type.md @@ -0,0 +1,6 @@ +Bugfix: Fix error type in read node when file was not found + +The method ReadNode in the ocis storage didn't return the error type NotFound when a file was not found. + +https://github.com/cs3org/reva/pull/323 + diff --git a/pkg/storage/fs/ocis/node.go b/pkg/storage/fs/ocis/node.go index 69043dfb1b5..2a6d32ed678 100644 --- a/pkg/storage/fs/ocis/node.go +++ b/pkg/storage/fs/ocis/node.go @@ -183,7 +183,7 @@ func ReadNode(ctx context.Context, lu *Lookup, id string) (n *Node, err error) { } else { log.Error().Err(err).Interface("node", n).Str("root.ID", root.ID).Msg("ReadNode()") if isNotFound(err) { - return + return nil, errtypes.NotFound(err.Error()) } return }