Class: Mysql::ErrorPacket

Inherits:
Object show all
Defined in:
lib/nose/proxy/mysql.rb

Overview

Serialize an error message

Class Method Summary collapse

Class Method Details

.serialize(errno, message) ⇒ String

Generate a packet with a given error number and message

Returns:

  • (String)


264
265
266
267
268
269
270
271
272
# File 'lib/nose/proxy/mysql.rb', line 264

def self.serialize(errno, message)
  [
    0xff,
    errno,
    '#',
    @sqlstate,
    message
  ].pack('Cvaa5a*')
end