1
0
Fork 0
mirror of https://github.com/fog/fog.git synced 2022-11-09 13:51:43 -05:00

Handle missing record case

This commit is contained in:
Trae Robrock 2013-07-28 13:13:06 -07:00
parent 3ba09b85b7
commit d8ffe4c411

View file

@ -37,6 +37,13 @@ module Fog
if self.data[:records].has_key? domain
response.status = 200
response.body = self.data[:records][domain].detect { |record| record["record"]["id"] == record_id }
if response.body.nil?
response.status = 404
response.body = {
"error" => "Couldn't find Record with id = #{record_id}"
}
end
else
response.status = 404
response.body = {