Exception: ClickhouseRuby::QueryError

Inherits:
Error
  • Object
show all
Defined in:
lib/clickhouse_ruby/errors.rb

Overview

Query execution errors Raised when there are issues executing a query

Instance Attribute Summary collapse

Attributes inherited from Error

#original_error

Instance Method Summary collapse

Constructor Details

#initialize(message = nil, code: nil, http_status: nil, sql: nil, original_error: nil) ⇒ QueryError



50
51
52
53
54
55
# File 'lib/clickhouse_ruby/errors.rb', line 50

def initialize(message = nil, code: nil, http_status: nil, sql: nil, original_error: nil)
  @code = code
  @http_status = http_status
  @sql = sql
  super(message, original_error: original_error)
end

Instance Attribute Details

#codeInteger? (readonly)



37
38
39
# File 'lib/clickhouse_ruby/errors.rb', line 37

def code
  @code
end

#http_statusString? (readonly)



40
41
42
# File 'lib/clickhouse_ruby/errors.rb', line 40

def http_status
  @http_status
end

#sqlString? (readonly)



43
44
45
# File 'lib/clickhouse_ruby/errors.rb', line 43

def sql
  @sql
end

Instance Method Details

#detailed_messageString

Returns a detailed error message including context



60
61
62
63
64
65
66
# File 'lib/clickhouse_ruby/errors.rb', line 60

def detailed_message
  parts = [message]
  parts << "Code: #{code}" if code
  parts << "HTTP Status: #{http_status}" if http_status
  parts << "SQL: #{sql}" if sql
  parts.join(" | ")
end