Change unique constraint error message

Summary:
As Tom requested in the #graphileon slack channel, I changed the error
message when node can't be updated.

Reviewers: mferencevic, ipaljak

Reviewed By: ipaljak

Subscribers: pullbot

Differential Revision: https://phabricator.memgraph.io/D1687
This commit is contained in:
Matija Santl 2018-10-22 09:26:44 +02:00
parent 84305f7423
commit 187da7f910

View File

@ -200,7 +200,7 @@ void GraphDbAccessor::PopulateIndex(const LabelPropertyIndex::Key &key) {
if (!db_.storage().label_property_index_.UpdateOnLabelProperty( if (!db_.storage().label_property_index_.UpdateOnLabelProperty(
vertex.address(), vertex.current_)) { vertex.address(), vertex.current_)) {
throw IndexConstraintViolationException( throw IndexConstraintViolationException(
"Index couldn't be populated due to constraint violation!"); "Index couldn't be created due to constraint violation!");
} }
} }
} }
@ -214,7 +214,7 @@ void GraphDbAccessor::UpdateLabelIndices(storage::Label label,
if (!db_.storage().label_property_index_.UpdateOnLabel(label, vlist_ptr, if (!db_.storage().label_property_index_.UpdateOnLabel(label, vlist_ptr,
vertex)) { vertex)) {
throw IndexConstraintViolationException( throw IndexConstraintViolationException(
"Index couldn't be updated due to constraint violation!"); "Node couldn't be updated due to index constraint violation!");
} }
db_.storage().labels_index_.Update(label, vlist_ptr, vertex); db_.storage().labels_index_.Update(label, vlist_ptr, vertex);
} }
@ -226,7 +226,7 @@ void GraphDbAccessor::UpdatePropertyIndex(
if (!db_.storage().label_property_index_.UpdateOnProperty( if (!db_.storage().label_property_index_.UpdateOnProperty(
property, vertex_accessor.address(), vertex)) { property, vertex_accessor.address(), vertex)) {
throw IndexConstraintViolationException( throw IndexConstraintViolationException(
"Index couldn't be updated due to constraint violation!"); "Node couldn't be updated due to index constraint violation!");
} }
} }