lib/bamboozled/errors.rb in bamboozled-0.0.7 vs lib/bamboozled/errors.rb in bamboozled-0.1.0
- old
+ new
@@ -10,22 +10,24 @@
@hint = hint
super(response)
end
def to_s
- "#{self.class.to_s} : #{response.code} #{response.body}" + (hint ? "\n#{hint}" : "")
+ "#{self.class} : #{response.code} #{response.body}".tap do |msg|
+ msg << "\n#{hint}" if hint
+ end
end
end
- class BadRequest < HTTPError; end #400
- class Unauthorized < HTTPError ; end #
- class AuthenticationFailed < HTTPError ; end #
- class Forbidden < HTTPError ; end # 403
- class NotFound < HTTPError; end # 404
- class NotAcceptable < HTTPError; end # 406
- class Conflict < HTTPError; end # 409
- class LimitExceeded < HTTPError; end # 429
- class InternalServerError < HTTPError; end # 500
- class GatewayError < HTTPError; end # 502
- class ServiceUnavailable < HTTPError; end # 503
+ class BadRequest < HTTPError; end
+ class Unauthorized < HTTPError; end
+ class AuthenticationFailed < HTTPError; end
+ class Forbidden < HTTPError; end
+ class NotFound < HTTPError; end
+ class NotAcceptable < HTTPError; end
+ class Conflict < HTTPError; end
+ class LimitExceeded < HTTPError; end
+ class InternalServerError < HTTPError; end
+ class GatewayError < HTTPError; end
+ class ServiceUnavailable < HTTPError; end
class InformBamboo < HTTPError; end
end