diff --git a/server/fileservice.go b/server/fileservice.go index d23dadd..465a93c 100644 --- a/server/fileservice.go +++ b/server/fileservice.go @@ -106,7 +106,11 @@ func (s *GRPCFileServiceServer) DeleteFile(ctx context.Context, req *pb.DeleteFi // Ensure owner of file or admin f, err := s.store.GetFile(req.Id) if err != nil { + if err == store.ErrNoSuchItem { + return nil, status.Error(codes.NotFound, "no such file") + } s.Logger.Warnw("Error getting file.", "error", err) + return nil, status.Errorf(codes.Internal, "error getting file: %s", err) } if !(f.Metadata.Owner == interceptors.UserIDFromContext(ctx) || interceptors.RoleFromContext(ctx) == pb.User_ADMIN) { return nil, status.Error(codes.PermissionDenied, "permission denied")