aboutsummaryrefslogtreecommitdiffstats
path: root/app
diff options
context:
space:
mode:
authorTeddy Wing2018-05-04 12:49:06 +0200
committerTeddy Wing2018-05-04 12:54:25 +0200
commit9c442cd66c7d12266ba53e85949f775f6b842d2d (patch)
tree6b9f901eda5bee3c84b192a979eb856b826d1304 /app
parentad49ad52ee8e7cfbf4dc3f1bc34c533e186100b9 (diff)
downloadchouette-core-9c442cd66c7d12266ba53e85949f775f6b842d2d.tar.bz2
Move `TomTom::Matrix::RemoteError` to`TomTom::Errors::MatrixRemoteError`6884-tomtom-matrix--handle-error-when-response-doesn,t-inclu
I previously tried to correct a circular dependency problem in a057276129b1f62b811743db3b8f867a05241ed3, but that didn't fix it (it was intermittent, and came back). After some wrangling, I've now deduced with some confidence that the problem comes from `RouteWayCostCalculator`, which used `TomTom::Matrix::RemoteError`. From the way it looks, this seems to mess up the Rails autoloader since `tom_tom.rb` will try to load the `Matrix` class from the `TomTom.matrix` call above. Or something. In an attempt to fix the circular dependency error for real this time, move the error class to a completely separate module from `Matrix`, and refer to this when we need to use the error class. Refs #6884
Diffstat (limited to 'app')
-rw-r--r--app/services/route_way_cost_calculator.rb2
1 files changed, 1 insertions, 1 deletions
diff --git a/app/services/route_way_cost_calculator.rb b/app/services/route_way_cost_calculator.rb
index 58f9ad1d0..ca47a6772 100644
--- a/app/services/route_way_cost_calculator.rb
+++ b/app/services/route_way_cost_calculator.rb
@@ -8,7 +8,7 @@ class RouteWayCostCalculator
way_costs = TomTom.matrix(way_costs)
way_costs = WayCostCollectionJSONSerializer.dump(way_costs)
@route.update(costs: way_costs)
- rescue TomTom::Matrix::RemoteError => e
+ rescue TomTom::Errors::MatrixRemoteError => e
Rails.logger.error "TomTom::Matrix server error: #{e}"
end
end