Sha256: 47acb24041134794ddb41d9b9045fdc58b296d001ff1fa0388f3b09c56496c0a

Contents?: true

Size: 652 Bytes

Versions: 19

Compression:

Stored size: 652 Bytes

Contents

module Twilio
  module REST
    class TwilioError < StandardError
      attr_reader :message, :body

      def initialize(message, body = nil)
        @message = message
        @body = body
      end

      def to_s
        "#{@message}: #{@body || 'no body'}"
      end
    end

    class RestError < TwilioError
      attr_reader :message, :code, :status_code

      def initialize(message, code, status_code)
        @message = message
        @code = code
        @status_code = status_code
      end

      def to_s
        "[HTTP #{status_code}] #{code} : #{message}"
      end
    end

    class ObsoleteError < StandardError
    end
  end
end

Version data entries

19 entries across 19 versions & 1 rubygems

Version Path
twilio-ruby-5.7.2 lib/twilio-ruby/framework/error.rb
twilio-ruby-5.7.1 lib/twilio-ruby/framework/error.rb
twilio-ruby-5.7.0 lib/twilio-ruby/framework/error.rb
twilio-ruby-5.6.4 lib/twilio-ruby/framework/error.rb
twilio-ruby-5.6.3 lib/twilio-ruby/framework/error.rb
twilio-ruby-5.6.2 lib/twilio-ruby/framework/error.rb
twilio-ruby-5.6.1 lib/twilio-ruby/framework/error.rb
twilio-ruby-5.6.0 lib/twilio-ruby/framework/error.rb
twilio-ruby-5.5.1 lib/twilio-ruby/framework/error.rb
twilio-ruby-5.5.0 lib/twilio-ruby/framework/error.rb
twilio-ruby-5.4.5 lib/twilio-ruby/framework/error.rb
twilio-ruby-5.4.4 lib/twilio-ruby/framework/error.rb
twilio-ruby-5.4.3 lib/twilio-ruby/framework/error.rb
twilio-ruby-5.4.2 lib/twilio-ruby/framework/error.rb
twilio-ruby-5.4.1 lib/twilio-ruby/framework/error.rb
twilio-ruby-5.4.0 lib/twilio-ruby/framework/error.rb
twilio-ruby-5.3.1 lib/twilio-ruby/framework/error.rb
twilio-ruby-5.3.0 lib/twilio-ruby/framework/error.rb
twilio-ruby-5.2.3 lib/twilio-ruby/framework/error.rb