exceptions.rb 426 B

123456789101112131415161718
  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 RaceConditionError < Error; end
  7. class UnexpectedResponseError < Error
  8. def initialize(response = nil)
  9. if response.respond_to? :uri
  10. super("#{response.uri} returned code #{response.code}")
  11. else
  12. super
  13. end
  14. end
  15. end
  16. end