1
0

exceptions.rb 684 B

1234567891011121314151617181920212223
  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 LengthValidationError < ValidationError; end
  8. class DimensionsValidationError < ValidationError; end
  9. class StreamValidationError < ValidationError; end
  10. class RaceConditionError < Error; end
  11. class RateLimitExceededError < Error; end
  12. class UnexpectedResponseError < Error
  13. def initialize(response = nil)
  14. if response.respond_to? :uri
  15. super("#{response.uri} returned code #{response.code}")
  16. else
  17. super
  18. end
  19. end
  20. end
  21. end