Class: ActiveResource::ClientError

Inherits:
ConnectionError
  • Object
show all
Defined in:
lib/moniker/base.rb

Overview

Reopen ActiveResource::ClientError to add the proper parsing for OpenStack errors

Instance Method Summary collapse

Instance Method Details

#messageObject



109
110
111
112
113
114
115
# File 'lib/moniker/base.rb', line 109

def message
  decoded_error = decode_openstack_error
  decoded_error.nil? ? @message : decoded_error
rescue Exception => e
  # Fallback to the original method
  @message
end

#old_messageObject



106
# File 'lib/moniker/base.rb', line 106

alias old_message message

#old_to_sObject



107
# File 'lib/moniker/base.rb', line 107

alias old_to_s to_s

#to_sObject



117
118
119
120
121
122
123
# File 'lib/moniker/base.rb', line 117

def to_s
  decoded_error = decode_openstack_error
  decoded_error.nil? ? old_to_s : decoded_error
rescue Exception => e
  # Fallback to the original method
  old_to_s
end