lib/grumlin.rb in grumlin-0.18.1 vs lib/grumlin.rb in grumlin-0.19.0

- old
+ new

@@ -15,10 +15,12 @@ require "async/queue" require "async/barrier" require "async/http/endpoint" require "async/websocket/client" +require "retryable" + require "zeitwerk" loader = Zeitwerk::Loader.for_gem loader.inflector.inflect( "rspec" => "RSpec", @@ -77,9 +79,30 @@ class ScriptEvaluationError < ServerSideError; end class InvalidRequestArgumentsError < ServerSideError; end class ServerError < ServerSideError; end + + class AlreadyExistsError < ServerError + attr_reader :id + + def initialize(status, query) + super + id = status[:message].split(":").last.strip + @id = id == "" ? nil : id + end + + # TODO: parse message and assign @id + # NOTE: Neptune does not return id. + end + + class VertexAlreadyExistsError < AlreadyExistsError; end + class EdgeAlreadyExistsError < AlreadyExistsError; end + + class ConcurrentInsertFailedError < ServerError; end + + class ConcurrentVertexInsertFailedError < ConcurrentInsertFailedError; end + class ConcurrentEdgeInsertFailedError < ConcurrentInsertFailedError; end class ServerSerializationError < ServerSideError; end class ServerTimeoutError < ServerSideError; end