question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Exception thrown with no details for NearBySearch

See original GitHub issue

The 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:closed
  • Created 4 years ago
  • Comments:7 (5 by maintainers)

github_iconTop GitHub Comments

1reaction
vivetcommented, Aug 4, 2019

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.

1reaction
vivetcommented, Aug 2, 2019

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.

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found