require "router"

router = Router.new("http://router.cluster:8080/router", Rails.logger)
router.application("whitehall", Plek.current.find("whitehall")) do |app|
  app.ensure_prefix_route Whitehall.router_prefix
end
require "router"

router = Router.new("http://router.cluster:8080/router", Rails.logger)
begin
  router.application("whitehall", Plek.current.find("whitehall")) do |app|
    app.ensure_prefix_route Whitehall.router_prefix
  end
rescue Router::Conflict => conflict_error
  Rails.logger.error "Route already exists: #{conflict_error.existing}"
  raise conflict_error
rescue Router::Remote => remote_error
  Rails.logger.error "Remote error response: #{remote_error.response}"
  raise remote_error
end

Add logging around route registration.
Add logging around route registration.

Occasionally we've seen Router::RemoteErrors occur on deployment. This
logging should give us a better chance of diagnosing what the problem
is.
