Sha256: cdf010571e24dabbc4c113916979e9e503033eba19a1fd05736036afca7eabe0

Contents?: true

Size: 385 Bytes

Versions: 9

Compression:

Stored size: 385 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
end

Version data entries

9 entries across 9 versions & 1 rubygems

Version Path
discourse_api-0.4.0 lib/discourse_api/error.rb
discourse_api-0.3.6 lib/discourse_api/error.rb
discourse_api-0.3.0 lib/discourse_api/error.rb
discourse_api-0.2.9 lib/discourse_api/error.rb
discourse_api-0.2.8 lib/discourse_api/error.rb
discourse_api-0.2.7 lib/discourse_api/error.rb
discourse_api-0.2.5 lib/discourse_api/error.rb
discourse_api-0.2.4 lib/discourse_api/error.rb
discourse_api-0.2.2 lib/discourse_api/error.rb