Skip to content

Commit 8af0132

Browse files
committed
fix: cloud_controller_ng#4971
1 parent b1f1251 commit 8af0132

1 file changed

Lines changed: 5 additions & 2 deletions

File tree

app/actions/manifest_route_update.rb

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,14 +18,16 @@ def update(app_guid, message, user_audit_info)
1818
app_guid => app
1919
}
2020
routes_to_map = []
21+
current_route = nil
2122

2223
message.manifest_route_mappings.each do |manifest_route_mapping|
24+
current_route = manifest_route_mapping[:route].to_s
2325
route = {
2426
model: find_or_create_valid_route(app, manifest_route_mapping[:route].to_hash, user_audit_info),
2527
protocol: manifest_route_mapping[:protocol]
2628
}
2729

28-
raise InvalidRoute.new("No domains exist for route #{manifest_route_mapping[:route]}") if route[:model].blank?
30+
raise InvalidRoute.new("No domains exist for route #{current_route}") if route[:model].blank?
2931

3032
routes_to_map << route
3133
end
@@ -53,7 +55,8 @@ def update(app_guid, message, user_audit_info)
5355
end
5456
end
5557
rescue Sequel::ValidationFailed, RouteCreate::Error, RouteUpdate::Error => e
56-
raise InvalidRoute.new(e.message)
58+
route_info = current_route ? "For route '#{current_route}': " : ''
59+
raise InvalidRoute.new("#{route_info}#{e.message}")
5760
end
5861

5962
private

0 commit comments

Comments
 (0)