lib/voog_api/error.rb in voog_api-0.0.10 vs lib/voog_api/error.rb in voog_api-0.0.11
- old
+ new
@@ -1,6 +1,13 @@
module Voog
# Raised when Voog API returns a 301 HTTP status code
- class MovedPermanently < StandardError; end
+ class MovedPermanently < StandardError
+ attr_reader :response
+
+ def initialize(response, hostname)
+ @response = response
+ super("#{hostname} is permanently redirected to #{response.headers['location'] if response}")
+ end
+ end
end