From 9d2fee7f7ded1d1687deff2a3dbf9aabb85f2248 Mon Sep 17 00:00:00 2001 From: Max De Marzi Date: Wed, 12 Feb 2014 22:44:27 -0600 Subject: [PATCH] add DeadlockDetectedException to fix #145 --- lib/neography/connection.rb | 1 + lib/neography/errors.rb | 3 +++ 2 files changed, 4 insertions(+) diff --git a/lib/neography/connection.rb b/lib/neography/connection.rb index d07241c..52cfffe 100644 --- a/lib/neography/connection.rb +++ b/lib/neography/connection.rb @@ -213,6 +213,7 @@ def raise_errors(code, exception, message, stacktrace, request, index) when /RelationshipNotFoundException/ ; RelationshipNotFoundException when /NotFoundException/ ; NotFoundException when /UniquePathNotUniqueException/ ; UniquePathNotUniqueException + when /DeadlockDetectedException/ ; DeadlockDetectedException else NeographyError end diff --git a/lib/neography/errors.rb b/lib/neography/errors.rb index 8b9ac49..d7711b6 100644 --- a/lib/neography/errors.rb +++ b/lib/neography/errors.rb @@ -44,4 +44,7 @@ class NotFoundException < NeographyError; end # Thrown when CREATE UNIQUE matches multiple paths. class UniquePathNotUniqueException < NeographyError; end + # Signals that a deadlock between two or more transactions has been detected + class DeadlockDetectedException < NeographyError; end + end