Exception: Restruct::LockerError

Inherits:
Error
  • Object
show all
Defined in:
lib/restruct/errors.rb

Instance Method Summary collapse

Constructor Details

#initialize(inner_exception) ⇒ LockerError



36
37
38
# File 'lib/restruct/errors.rb', line 36

def initialize(inner_exception)
  @inner_exception = inner_exception
end

Instance Method Details

#backtraceObject



44
45
46
# File 'lib/restruct/errors.rb', line 44

def backtrace
  @inner_exception.backtrace
end

#messageObject



40
41
42
# File 'lib/restruct/errors.rb', line 40

def message
  @parsed_message ||= parse_message @inner_exception.message
end

#parse_message(message) ⇒ Object



48
49
50
51
# File 'lib/restruct/errors.rb', line 48

def parse_message(message)
  match_data = /^(ERR Error running script.*@user_script.*user_script.*: )/.match message
  match_data ? message.gsub(match_data.captures.first,'').strip : message
end