Exception: Cubrid2::Error
- Inherits:
-
StandardError
- Object
- StandardError
- Cubrid2::Error
- Defined in:
- lib/cubrid2/error.rb
Constant Summary collapse
- ENCODE_OPTS =
{ undef: :replace, invalid: :replace, replace: '?'.freeze }.freeze
- ConnectionError =
Class.new(Error)
- TimeoutError =
Class.new(Error)
Instance Attribute Summary collapse
-
#error_number ⇒ Object
(also: #err_code)
readonly
Returns the value of attribute error_number.
-
#sql_state ⇒ Object
readonly
Returns the value of attribute sql_state.
Instance Method Summary collapse
-
#initialize(msg, server_version = nil, error_number = nil, sql_state = nil) ⇒ Error
constructor
A new instance of Error.
Constructor Details
#initialize(msg, server_version = nil, error_number = nil, sql_state = nil) ⇒ Error
Returns a new instance of Error.
78 79 80 81 82 83 84 |
# File 'lib/cubrid2/error.rb', line 78 def initialize(msg, server_version = nil, error_number = nil, sql_state = nil) @server_version = server_version @error_number = error_number @sql_state = sql_state ? sql_state.encode(**ENCODE_OPTS) : nil super msg end |
Instance Attribute Details
#error_number ⇒ Object (readonly) Also known as: err_code
Returns the value of attribute error_number.
12 13 14 |
# File 'lib/cubrid2/error.rb', line 12 def error_number @error_number end |
#sql_state ⇒ Object (readonly)
Returns the value of attribute sql_state.
12 13 14 |
# File 'lib/cubrid2/error.rb', line 12 def sql_state @sql_state end |