2016-12-22 21:34:19 +01:00
|
|
|
# frozen_string_literal: true
|
|
|
|
|
|
|
|
module Mastodon
|
|
|
|
class Error < StandardError; end
|
2017-02-26 23:23:06 +01:00
|
|
|
class NotPermittedError < Error; end
|
|
|
|
class ValidationError < Error; end
|
2018-02-24 19:16:11 +01:00
|
|
|
class HostValidationError < ValidationError; end
|
2018-03-26 14:02:10 +02:00
|
|
|
class LengthValidationError < ValidationError; end
|
2018-04-23 09:16:38 +02:00
|
|
|
class DimensionsValidationError < ValidationError; end
|
2017-04-03 22:54:46 +02:00
|
|
|
class RaceConditionError < Error; end
|
2020-03-08 15:17:39 +01:00
|
|
|
class RateLimitExceededError < Error; end
|
2017-07-20 01:59:07 +02:00
|
|
|
|
|
|
|
class UnexpectedResponseError < Error
|
|
|
|
def initialize(response = nil)
|
2017-07-27 00:38:20 +02:00
|
|
|
if response.respond_to? :uri
|
|
|
|
super("#{response.uri} returned code #{response.code}")
|
|
|
|
else
|
|
|
|
super
|
|
|
|
end
|
2017-07-20 01:59:07 +02:00
|
|
|
end
|
|
|
|
end
|
2016-12-22 21:34:19 +01:00
|
|
|
end
|