Class: Librails::MiscUtils

Inherits:
Object
  • Object
show all
Defined in:
lib/librails/misc_utils.rb

Class Method Summary collapse

Class Method Details

.rescue_mysql2_error(e) ⇒ Object



3
4
5
6
7
8
9
10
11
# File 'lib/librails/misc_utils.rb', line 3

def self.rescue_mysql2_error(e)
  if e.message =~ /Incorrect string value:/
    # utf8mb4にすればいいのだ…。とりあえずそのばしのぎ。
    puts e.message
  else
    puts e.message
    puts e.backtrace
  end
end