From 5733e166e08c635a938d0d988fcc58131144f8d4 Mon Sep 17 00:00:00 2001 From: David Christofas Date: Tue, 3 Nov 2020 13:23:06 +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 0000000000..9b36d897f9 --- /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/1294 + diff --git a/pkg/storage/fs/ocis/node.go b/pkg/storage/fs/ocis/node.go index 69043dfb1b..2a6d32ed67 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 }