module Flydata class AgentError < StandardError def self.description text = <<-EOM Fix the issue and try again. If the problem continues, please contact support@flydata.com EOM flydata_log = File.join(FLYDATA_HOME, 'flydata.log') if File.exists?(flydata_log) text += <<-EOM Also check the Agent log. Log path: #{flydata_log} EOM end text end def description if instance_variable_defined?(:@description) && @description @description else self.class.description end end attr_writer :description end class ServerDataProcessingTimeout < AgentError def initialize(message, options = {}) super(message) @state = options[:state] end attr_reader :state end class DumpParseError < AgentError end class AgentInternalError < AgentError NO_VALID_TABLE_ERR = 101 NO_DATA_ENTRY_ERR = 102 UNKNOWN_ERR = 999 def initialize(message, code = UNKNOWN_ERR) super("#{message} code:#{code}") @code = code end attr_reader :code end end