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:
parent
3ba09b85b7
commit
d8ffe4c411
1 changed files with 7 additions and 0 deletions
|
@ -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 = {
|
||||
|
|
Loading…
Add table
Reference in a new issue