Exception: Neo4j::Core::CypherSession::CypherError
- Inherits:
-
StandardError
- Object
- StandardError
- Neo4j::Core::CypherSession::CypherError
- Defined in:
- lib/neo4j/core/cypher_session/adaptors.rb
Direct Known Subclasses
SchemaErrors::ConstraintAlreadyExistsError, SchemaErrors::ConstraintValidationFailedError, SchemaErrors::IndexAlreadyExistsError
Instance Attribute Summary collapse
-
#code ⇒ Object
readonly
Returns the value of attribute code.
-
#original_message ⇒ Object
readonly
Returns the value of attribute original_message.
-
#stack_trace ⇒ Object
readonly
Returns the value of attribute stack_trace.
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(code = nil, original_message = nil, stack_trace = nil) ⇒ CypherError
constructor
A new instance of CypherError.
Constructor Details
#initialize(code = nil, original_message = nil, stack_trace = nil) ⇒ CypherError
Returns a new instance of CypherError.
12 13 14 15 16 17 18 19 20 21 22 23 |
# File 'lib/neo4j/core/cypher_session/adaptors.rb', line 12 def initialize(code = nil, = nil, stack_trace = nil) @code = code @original_message = @stack_trace = stack_trace msg = <<-ERROR Cypher error: #{ANSI::CYAN}#{code}#{ANSI::CLEAR}: #{} #{stack_trace} ERROR super(msg) end |
Instance Attribute Details
#code ⇒ Object (readonly)
Returns the value of attribute code.
10 11 12 |
# File 'lib/neo4j/core/cypher_session/adaptors.rb', line 10 def code @code end |
#original_message ⇒ Object (readonly)
Returns the value of attribute original_message.
10 11 12 |
# File 'lib/neo4j/core/cypher_session/adaptors.rb', line 10 def @original_message end |
#stack_trace ⇒ Object (readonly)
Returns the value of attribute stack_trace.
10 11 12 |
# File 'lib/neo4j/core/cypher_session/adaptors.rb', line 10 def stack_trace @stack_trace end |
Class Method Details
.error_class_from(code) ⇒ Object
30 31 32 33 34 35 36 37 38 39 40 41 |
# File 'lib/neo4j/core/cypher_session/adaptors.rb', line 30 def self.error_class_from(code) case code when /(ConstraintValidationFailed|ConstraintViolation)/ SchemaErrors::ConstraintValidationFailedError when /IndexAlreadyExists/ SchemaErrors::IndexAlreadyExistsError when /ConstraintAlreadyExists/ # ????? SchemaErrors::ConstraintAlreadyExistsError else CypherError end end |
.new_from(code, message, stack_trace = nil) ⇒ Object
26 27 28 |
# File 'lib/neo4j/core/cypher_session/adaptors.rb', line 26 def self.new_from(code, , stack_trace = nil) error_class_from(code).new(code, , stack_trace) end |