From 0c58da3917760f704943dea4fcf821b4bd9e05ea Mon Sep 17 00:00:00 2001 From: Riccardo Boero <ribo@nilu.no> Date: Wed, 3 Apr 2024 10:08:45 +0200 Subject: [PATCH] Moved missing travel time out of try catch --- src/FACT_road.jl | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/FACT_road.jl b/src/FACT_road.jl index b5f4892..792ef09 100644 --- a/src/FACT_road.jl +++ b/src/FACT_road.jl @@ -49,6 +49,8 @@ function travel_time_in_minutes(ws_host_port::String, selection::Dict) # Construct the request URL url = "$ws_host_port/route/v1/driving/$(start_longitude),$(start_latitude);$(end_longitude),$(end_latitude)?overview=false" + travel_time = missing # Use `missing` to represent null in Julia + try # Make the request response = HTTP.get(url) @@ -63,7 +65,6 @@ function travel_time_in_minutes(ws_host_port::String, selection::Dict) travel_time = travel_time_seconds / 60 catch e println("Error during HTTP request or response parsing: ", e) - travel_time = missing # Use `missing` to represent null in Julia end # Populate the columns -- GitLab