exceptions.rb 477 B

12345678910111213141516171819
  1. # frozen_string_literal: true
  2. module Mastodon
  3. class Error < StandardError; end
  4. class NotPermittedError < Error; end
  5. class ValidationError < Error; end
  6. class HostValidationError < ValidationError; end
  7. class RaceConditionError < Error; end
  8. class UnexpectedResponseError < Error
  9. def initialize(response = nil)
  10. if response.respond_to? :uri
  11. super("#{response.uri} returned code #{response.code}")
  12. else
  13. super
  14. end
  15. end
  16. end
  17. end