Exception: Eaco::Error

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

Overview

An Eaco Runtime Error.

Direct Known Subclasses

Forbidden, Malformed

Instance Method Summary collapse

Constructor Details

#initialize(message) ⇒ Error

As we make use of heredoc for long error messages, squeeze subsequent spaces and remove newlines.



10
11
12
13
14
15
16
# File 'lib/eaco/error.rb', line 10

def initialize(message)
  unless message =~ %r{EACO.+Error}
    message = message.squeeze(' ').gsub("\n", '')
  end

  super message
end