Sha256: 7e63b5da830f81ee68f01cb43ed8f5cb812eb5734e2f529b1867ce6afaf90963
Contents?: true
Size: 821 Bytes
Versions: 6
Compression:
Stored size: 821 Bytes
Contents
# frozen_string_literal: true module DiscourseApi class DiscourseError < StandardError attr_reader :response def initialize(message, response = nil) super(message) @response = response end end class Error < DiscourseError 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 < DiscourseError end class NotFoundError < DiscourseError end class UnprocessableEntity < DiscourseError end class TooManyRequests < DiscourseError end class Timeout < Error end end
Version data entries
6 entries across 6 versions & 1 rubygems