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