Exception: StandardError
- Inherits:
-
Exception
- Object
- Exception
- StandardError
- Defined in:
- lib/ass_ole/core_patch/standard_error.rb
Overview
Monkey patch for encoding error message
Direct Known Subclasses
Class Method Summary collapse
Class Method Details
.__patch_message__ ⇒ Object
3 4 5 6 7 8 9 10 |
# File 'lib/ass_ole/core_patch/standard_error.rb', line 3 def self. = instance_method(:message) define_method(:message) do .bind(self).call.force_encoding('ASCII-8BIT')\ .split(%r{(HRESULT error code:\dx\d+)}i)[0 .. 1].join .force_encoding('UTF-8').strip end end |