module RailsConnector class BackendNotAvailable < StandardError attr_reader :http_code def self.from_socket_error(socket_error) new(socket_error.message, 503) end def initialize(message, http_code) @http_code = http_code.to_i super(message) end end end