Exception thrown with no details for NearBySearch
See original GitHub issueThe following call fails and the exception does not say much. Seems like the Address does not work for PlacesNearBySearchRequest. Tried with Longitude and Latitude only and that worked.
var request = new PlacesNearBySearchRequest()
{
Key = "MY GOOGLE API KEY"
};
request.Location = new Location() { Address = "456 Some Street, Some City" };
request.Radius = 1000;
var response = await GooglePlaces.NearBySearch.QueryAsync(request, cancellationToken);
GoogleApi.Exceptions.GoogleApiException: InvalidRequest:
at GoogleApi.HttpEngine`2.<>c__DisplayClass2_0.<<QueryAsync>b__0>d.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at GoogleApi.HttpEngine`2.QueryAsync(TRequest request, CancellationToken cancellationToken)
at MyApp.Services.PlacesService.ListPlaces(String address, CancellationToken cancellationToken) in \MyApp\MyApp\Services\PlacesService.cs:line 22
at MyApp.Controllers.PlacesController.Get(CancellationToken cancellationToken) in MyApp\MyApp\Controllers\PlacesController.cs:line 31
at lambda_method(Closure , Object )
at Microsoft.Extensions.Internal.ObjectMethodExecutorAwaitable.Awaiter.GetResult()
at Microsoft.AspNetCore.Mvc.Internal.ActionMethodExecutor.AwaitableObjectResultExecutor.Execute(IActionResultTypeMapper mapper, ObjectMethodExecutor executor, Object controller, Object[] arguments)
at System.Threading.Tasks.ValueTask`1.get_Result()
at Microsoft.AspNetCore.Mvc.Internal.ControllerActionInvoker.InvokeActionMethodAsync()
at Microsoft.AspNetCore.Mvc.Internal.ControllerActionInvoker.InvokeNextActionFilterAsync()
at Microsoft.AspNetCore.Mvc.Internal.ControllerActionInvoker.Rethrow(ActionExecutedContext context)
Issue Analytics
- State:
- Created 4 years ago
- Comments:7 (5 by maintainers)
Top Results From Across the Web
Google Places Web API incorrectly throwing error and ...
The issue is that bounds is not valid when you are calling the service. The map is initialized asynchronously, the bounds isn't available ......
Read more >Places Service | Maps JavaScript API
Retrieves details about the place identified by the given placeId . nearbySearch. nearbySearch(request, callback). Parameters: request : PlaceSearchRequest ...
Read more >How to find out where an Exception was thrown
I have an application that in one method calls two other methods respectively, and both methods may throw IOException and i like to...
Read more >Google Maps Search Nearby : Displaying ...
Google Maps Search Nearby In this post we will learn how to find nearby places in Google Maps. We will first see how...
Read more >PC Laptop Repair
Repair guides and disassembly information for PC laptops of all shapes, sizes, and colors. PC Laptop troubleshooting, repair, and service manuals.
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found

Hi I checked the google places documentation, and it seems you can’t use an address string with nearby search, but only a location of latitude, longitude. I will update to remove the incorrect Location.Address for the nearby search request.
Hi Your address seems strange. Have you tried with a real address? If so, I will try to do some tests. I am in vacation until Monday, but I can take a look when I am back.