Sha256: 499a2e7d7e7b81f3f44d357aef3ab5ccd6b615853d39273f0d5edd81dc962ea7

Contents?: true

Size: 549 Bytes

Versions: 3

Compression:

Stored size: 549 Bytes

Contents

require 'net/http'

module Fluent
  module GoogleChatClient
    class Error < StandardError
      attr_reader :res, :req_params

      def initialize(res, req_params = {})
        @res        = res
        @req_params = req_params.dup
      end

      def message
        @req_params[:token] = '[FILTERED]' if @req_params[:token]
        "res.code:#{@res.code}, res.body:#{@res.body}, req_params:#{@req_params}"
      end

      alias :to_s :message
    end

    class SpaceNotFoundError < Error; end
    class NameTakenError < Error; end
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
fluent-plugin-google-chat-0.0.3 lib/fluent/plugin/google_chat_client/error.rb
fluent-plugin-google-chat-0.0.2 lib/fluent/plugin/google_chat_client/error.rb
fluent-plugin-google-chat-0.0.1 lib/fluent/plugin/google_chat_client/error.rb