diff --git a/skills/src/csharp/pointofinterestskill/pointofinterestskill/Dialogs/RouteDialog.cs b/skills/src/csharp/pointofinterestskill/pointofinterestskill/Dialogs/RouteDialog.cs index 8f04475950..5e0c8d8432 100644 --- a/skills/src/csharp/pointofinterestskill/pointofinterestskill/Dialogs/RouteDialog.cs +++ b/skills/src/csharp/pointofinterestskill/pointofinterestskill/Dialogs/RouteDialog.cs @@ -241,7 +241,7 @@ public async Task RouteToFindPointOfInterestBeforeRouteDialog( if (cards.Count() == 0) { - var replyMessage = ResponseManager.GetResponse(POISharedResponses.NoLocationsFound); + var replyMessage = ResponseManager.GetResponse(POISharedResponses.NoRouteFound); await sc.Context.SendActivityAsync(replyMessage); } else if (cards.Count() == 1) diff --git a/skills/src/csharp/pointofinterestskill/pointofinterestskill/Responses/Shared/POISharedResponses.cs b/skills/src/csharp/pointofinterestskill/pointofinterestskill/Responses/Shared/POISharedResponses.cs index 31a2ed7412..f64341c127 100644 --- a/skills/src/csharp/pointofinterestskill/pointofinterestskill/Responses/Shared/POISharedResponses.cs +++ b/skills/src/csharp/pointofinterestskill/pointofinterestskill/Responses/Shared/POISharedResponses.cs @@ -25,6 +25,7 @@ public class POISharedResponses : IResponseIdCollection public const string NoLocationsFound = "NoLocationsFound"; public const string MultipleRoutesFound = "MultipleRoutesFound"; public const string SingleRouteFound = "SingleRouteFound"; + public const string NoRouteFound = "NoRouteFound"; public const string PointOfInterestSelection = "PointOfInterestSelection"; public const string CurrentLocationMultipleSelection = "CurrentLocationMultipleSelection"; public const string CurrentLocationSingleSelection = "CurrentLocationSingleSelection"; diff --git a/skills/src/csharp/pointofinterestskill/pointofinterestskill/Responses/Shared/POISharedResponses.de.json b/skills/src/csharp/pointofinterestskill/pointofinterestskill/Responses/Shared/POISharedResponses.de.json index e33dea2462..339807fc8c 100644 Binary files a/skills/src/csharp/pointofinterestskill/pointofinterestskill/Responses/Shared/POISharedResponses.de.json and b/skills/src/csharp/pointofinterestskill/pointofinterestskill/Responses/Shared/POISharedResponses.de.json differ diff --git a/skills/src/csharp/pointofinterestskill/pointofinterestskill/Responses/Shared/POISharedResponses.es.json b/skills/src/csharp/pointofinterestskill/pointofinterestskill/Responses/Shared/POISharedResponses.es.json index 78063102c2..89d4a467fc 100644 Binary files a/skills/src/csharp/pointofinterestskill/pointofinterestskill/Responses/Shared/POISharedResponses.es.json and b/skills/src/csharp/pointofinterestskill/pointofinterestskill/Responses/Shared/POISharedResponses.es.json differ diff --git a/skills/src/csharp/pointofinterestskill/pointofinterestskill/Responses/Shared/POISharedResponses.fr.json b/skills/src/csharp/pointofinterestskill/pointofinterestskill/Responses/Shared/POISharedResponses.fr.json index 8ec400def4..e9fe07cdd7 100644 Binary files a/skills/src/csharp/pointofinterestskill/pointofinterestskill/Responses/Shared/POISharedResponses.fr.json and b/skills/src/csharp/pointofinterestskill/pointofinterestskill/Responses/Shared/POISharedResponses.fr.json differ diff --git a/skills/src/csharp/pointofinterestskill/pointofinterestskill/Responses/Shared/POISharedResponses.it.json b/skills/src/csharp/pointofinterestskill/pointofinterestskill/Responses/Shared/POISharedResponses.it.json index ed63559d71..f2470fde86 100644 Binary files a/skills/src/csharp/pointofinterestskill/pointofinterestskill/Responses/Shared/POISharedResponses.it.json and b/skills/src/csharp/pointofinterestskill/pointofinterestskill/Responses/Shared/POISharedResponses.it.json differ diff --git a/skills/src/csharp/pointofinterestskill/pointofinterestskill/Responses/Shared/POISharedResponses.json b/skills/src/csharp/pointofinterestskill/pointofinterestskill/Responses/Shared/POISharedResponses.json index 1247e92fb2..746c5d45e3 100644 --- a/skills/src/csharp/pointofinterestskill/pointofinterestskill/Responses/Shared/POISharedResponses.json +++ b/skills/src/csharp/pointofinterestskill/pointofinterestskill/Responses/Shared/POISharedResponses.json @@ -216,6 +216,15 @@ ], "inputHint": "expectingInput" }, + "NoRouteFound": { + "replies": [ + { + "text": "Sorry, I didn't find any route.", + "speak": "Sorry, I didn't find any route." + } + ], + "inputHint": "acceptingInput" + }, "PointOfInterestSelection": { "replies": [ { diff --git a/skills/src/csharp/pointofinterestskill/pointofinterestskill/Responses/Shared/POISharedResponses.zh.json b/skills/src/csharp/pointofinterestskill/pointofinterestskill/Responses/Shared/POISharedResponses.zh.json index 786a26e0aa..9407ff63dd 100644 --- a/skills/src/csharp/pointofinterestskill/pointofinterestskill/Responses/Shared/POISharedResponses.zh.json +++ b/skills/src/csharp/pointofinterestskill/pointofinterestskill/Responses/Shared/POISharedResponses.zh.json @@ -226,6 +226,15 @@ ], "inputHint": "expectingInput" }, + "NoRouteFound": { + "inputHint": "acceptingInput", + "replies": [ + { + "text": "对不起,我找不到任何路线。", + "speak": "对不起,我找不到任何路线。" + } + ] + }, "CurrentLocationSingleSelection": { "replies": [ { diff --git a/skills/src/csharp/pointofinterestskill/pointofinterestskill/Services/AzureMapsGeoSpatialService.cs b/skills/src/csharp/pointofinterestskill/pointofinterestskill/Services/AzureMapsGeoSpatialService.cs index 6097a720e9..8c98bd6f63 100644 --- a/skills/src/csharp/pointofinterestskill/pointofinterestskill/Services/AzureMapsGeoSpatialService.cs +++ b/skills/src/csharp/pointofinterestskill/pointofinterestskill/Services/AzureMapsGeoSpatialService.cs @@ -265,9 +265,16 @@ void AddPoint(double longitude, double latitude) /// RouteDirections. private async Task GetRouteDirectionsAsync(string url) { - var response = await httpClient.GetStringAsync(url); + var response = await httpClient.GetAsync(url); + + var apiResponse = new RouteDirections(); - var apiResponse = JsonConvert.DeserializeObject(response); + // TODO when it returns 400 for uncovered areas, we return no route instead. For other unsuccessful codes, exception is thrown as usual + if (response.StatusCode != System.Net.HttpStatusCode.BadRequest) + { + response = response.EnsureSuccessStatusCode(); + apiResponse = JsonConvert.DeserializeObject(await response.Content.ReadAsStringAsync()); + } apiResponse.Provider = PointOfInterestModel.AzureMaps;