Sha256: 5d7e20112e2258f143571bce99fe5f2dd1348f6841116e1551bac619ba26e36a

Contents?: true

Size: 744 Bytes

Versions: 11

Compression:

Stored size: 744 Bytes

Contents

module SlackRubyBot
  module Commands
    class Base
      class << self
        alias _invoke invoke

        def invoke(client, data)
          _invoke client, data
        rescue Mongoid::Errors::Validations => e
          logger.info "#{name.demodulize.upcase}: #{client.owner}, error - #{e.document.class}, #{e.document.errors.to_hash}"
          client.say(channel: data.channel, text: e.document.errors.first[1], gif: 'error')
          true
        rescue StandardError => e
          logger.info "#{name.demodulize.upcase}: #{client.owner}, #{e.class}: #{e}"
          logger.debug e.backtrace.join("\n")
          client.say(channel: data.channel, text: e.message, gif: 'error')
          true
        end
      end
    end
  end
end

Version data entries

11 entries across 11 versions & 1 rubygems

Version Path
slack-ruby-bot-server-0.12.1 lib/slack-ruby-bot-server/ext/mongoid/slack-ruby-bot/commands/base.rb
slack-ruby-bot-server-0.12.0 lib/slack-ruby-bot-server/ext/mongoid/slack-ruby-bot/commands/base.rb
slack-ruby-bot-server-0.11.1 lib/slack-ruby-bot-server/ext/mongoid/slack-ruby-bot/commands/base.rb
slack-ruby-bot-server-0.11.0 lib/slack-ruby-bot-server/ext/mongoid/slack-ruby-bot/commands/base.rb
slack-ruby-bot-server-0.10.0 lib/slack-ruby-bot-server/ext/mongoid/slack-ruby-bot/commands/base.rb
slack-ruby-bot-server-0.9.0 lib/slack-ruby-bot-server/ext/mongoid/slack-ruby-bot/commands/base.rb
slack-ruby-bot-server-0.8.3 lib/slack-ruby-bot-server/ext/mongoid/slack-ruby-bot/commands/base.rb
slack-ruby-bot-server-0.8.2 lib/slack-ruby-bot-server/ext/mongoid/slack-ruby-bot/commands/base.rb
slack-ruby-bot-server-0.8.1 lib/slack-ruby-bot-server/ext/mongoid/slack-ruby-bot/commands/base.rb
slack-ruby-bot-server-0.8.0 lib/slack-ruby-bot-server/ext/mongoid/slack-ruby-bot/commands/base.rb
slack-ruby-bot-server-0.7.0 lib/slack-ruby-bot-server/ext/mongoid/slack-ruby-bot/commands/base.rb