Project

General

Profile

« Previous | Next » 

Revision fcc0d38b

Added by Ohad Levy over 12 years ago

  • ID fcc0d38bc89a9a3d6d372469bbc3a697e3b787f1

fixes #1149 - add backtrace to log failures

View differences:

lib/dhcp_api.rb
end
@subnets = @server.subnets
rescue => e
log_halt 400, e.to_s
log_halt 400, e
end
helpers do
......
erb :"dhcp/index"
end
rescue => e
log_halt 400, e.to_s
log_halt 400, e
end
end
......
erb :"dhcp/show"
end
rescue => e
log_halt 400, e.to_s
log_halt 400, e
end
end
......
content_type :json
({:ip => load_subnet.unused_ip}).to_json
rescue => e
log_halt 400, e.to_s
log_halt 400, e
end
end
......
log_halt 404, "Record #{params[:network]}/#{params[:record]} not found" unless record
record.options.to_json
rescue => e
log_halt 400, e.to_s
log_halt 400, e
end
end
......
options = params.reject{|k,v| k["network"]}
@server.addRecord(options)
rescue Proxy::DHCP::Collision => e
log_halt 409, e.to_s
log_halt 409, e
rescue Proxy::DHCP::AlreadyExists
# no need to do anything
rescue => e
log_halt 400, e.to_s
log_halt 400, e
end
end
......
redirect "/dhcp/#{params[:network]}"
end
rescue Exception => e
log_halt 400, e.to_s
log_halt 400, e
end
end
end

Also available in: Unified diff