Extend the Error enum instead of a separate type

The error representing that a vertex is already inserted into the
skip-list was represented by the struct AlreadyInseertedElement. Instead
of using that struct, extend the memgraph::storage::v3::Error scoped
enum and use that to represent the double-insertion error.
This commit is contained in:
gvolfing
2022-11-07 10:00:34 +01:00
parent 3d954e7abc
commit 39b40ecf00
7 changed files with 52 additions and 12 deletions

View File

@@ -489,6 +489,7 @@ class BoltSession final : public memgraph::communication::bolt::Session<memgraph
case memgraph::storage::v3::Error::VERTEX_HAS_EDGES:
case memgraph::storage::v3::Error::PROPERTIES_DISABLED:
case memgraph::storage::v3::Error::NONEXISTENT_OBJECT:
case memgraph::storage::v3::Error::VERTEX_ALREADY_INSERTED:
throw memgraph::communication::bolt::ClientError("Unexpected storage error when streaming summary.");
}
}
@@ -523,6 +524,7 @@ class BoltSession final : public memgraph::communication::bolt::Session<memgraph
case memgraph::storage::v3::Error::VERTEX_HAS_EDGES:
case memgraph::storage::v3::Error::SERIALIZATION_ERROR:
case memgraph::storage::v3::Error::PROPERTIES_DISABLED:
case memgraph::storage::v3::Error::VERTEX_ALREADY_INSERTED:
throw memgraph::communication::bolt::ClientError("Unexpected storage error when streaming results.");
}
}