Exception: Mysql2::Error

Inherits:
StandardError
  • Object
show all
Defined in:
lib/mysql2/error.rb

Constant Summary

REPLACEMENT_CHAR =
'?'
ENCODE_OPTS =
{:undef => :replace, :invalid => :replace, :replace => REPLACEMENT_CHAR}

Instance Attribute Summary (collapse)

Instance Method Summary (collapse)

Constructor Details

- (Error) initialize(msg, server_version = nil)

Returns a new instance of Error



15
16
17
18
19
# File 'lib/mysql2/error.rb', line 15

def initialize(msg, server_version=nil)
  self.server_version = server_version

  super(clean_message(msg))
end

Instance Attribute Details

- (Object) error_number Also known as: errno

Returns the value of attribute error_number



8
9
10
# File 'lib/mysql2/error.rb', line 8

def error_number
  @error_number
end

- (Object) server_version=(value) (writeonly)

Sets the attribute server_version

Parameters:

  • value

    the value to set the attribute server_version to.



9
10
11
# File 'lib/mysql2/error.rb', line 9

def server_version=(value)
  @server_version = value
end

- (Object) sql_state

Returns the value of attribute sql_state



8
9
10
# File 'lib/mysql2/error.rb', line 8

def sql_state
  @sql_state
end