Skip to content
This repository has been archived by the owner on Jun 10, 2018. It is now read-only.

Error handling for 404 #30

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 6 additions & 2 deletions bin/global_phone_dbgen
Original file line number Diff line number Diff line change
Expand Up @@ -52,8 +52,12 @@ while arg = ARGV.shift
end
end

generator = GlobalPhone::DatabaseGenerator.load(open(path).read)
result = generator.send(method)
begin
generator = GlobalPhone::DatabaseGenerator.load(open(path).read)
result = generator.send(method)
rescue => e
puts "Could not retrieve remote XML: #{e}"
end

if compact
puts JSON.generate(result)
Expand Down