Sha256: 0ed599a96d86e4fc8b5a129cb85937979825b461402437a9c21947783ec527b6

Contents?: true

Size: 437 Bytes

Versions: 18

Compression:

Stored size: 437 Bytes

Contents

module DiscourseApi
  class Error < StandardError
    attr_reader :wrapped_exception

    # Initializes a new Error object
    #
    # @param exception [Exception, String]
    # @return [DiscourseApi::Error]
    def initialize(exception=$!)
      @wrapped_exception = exception
      exception.respond_to?(:message) ? super(exception.message) : super(exception.to_s)
    end
  end

  class UnauthenticatedError < StandardError
  end
end

Version data entries

18 entries across 18 versions & 1 rubygems

Version Path
discourse_api-0.13.0 lib/discourse_api/error.rb
discourse_api-0.12.0 lib/discourse_api/error.rb
discourse_api-0.10.1 lib/discourse_api/error.rb
discourse_api-0.10.0 lib/discourse_api/error.rb
discourse_api-0.9.1 lib/discourse_api/error.rb
discourse_api-0.9.0 lib/discourse_api/error.rb
discourse_api-0.8.1 lib/discourse_api/error.rb
discourse_api-0.8.0 lib/discourse_api/error.rb
discourse_api-0.7.0 lib/discourse_api/error.rb
discourse_api-0.6.2 lib/discourse_api/error.rb
discourse_api-0.6.1 lib/discourse_api/error.rb
discourse_api-0.6.0 lib/discourse_api/error.rb
discourse_api-0.5.1 lib/discourse_api/error.rb
discourse_api-0.5.0 lib/discourse_api/error.rb
discourse_api-0.4.4 lib/discourse_api/error.rb
discourse_api-0.4.3 lib/discourse_api/error.rb
discourse_api-0.4.2 lib/discourse_api/error.rb
discourse_api-0.4.1 lib/discourse_api/error.rb