Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Handle 504 error in Yelp #405

Open
gcampax opened this issue Jul 30, 2021 · 0 comments
Open

Handle 504 error in Yelp #405

gcampax opened this issue Jul 30, 2021 · 0 comments
Labels
bug P3 Nice to have, not working on it for now release: main Issues that affect devices in the "main" release

Comments

@gcampax
Copy link
Contributor

gcampax commented Jul 30, 2021

On occasion, Yelp requests time out with error 504:

Failed to invoke query HTTPError: Unexpected HTTP error 504 in request to https://api.yelp.com/v3/businesses/search?limit=50&sort_by=best_match&locale=en_US&latitude=37.442156&longitude=-122.1634471&categories=restaurants
    at IncomingMessage.<anonymous> (/home/travis/build/stanford-oval/thingpedia-common-devices/node_modules/thingpedia/dist/helpers/http.js:139:35)
    at IncomingMessage.emit (events.js:326:22)
    at endReadableNT (_stream_readable.js:1241:12)
    at processTicksAndRejections (internal/process/task_queues.js:84:21) {
  code: 504,
  url: 'https://api.yelp.com/v3/businesses/search?limit=50&sort_by=best_match&locale=en_US&latitude=37.442156&longitude=-122.1634471&categories=restaurants',
  detail: `{"error": {"code": "REQUEST_TIMED_OUT", "description": "The request timed out, please try again later. If this continues, please create an issue on GitHub with the request you're making: https://github.com/Yelp/yelp-fusion/issues"}}`
}

We should catch the error, convert it to a well-defined error code, and then show a meaningful message to the user.

@gcampax gcampax added bug release: main Issues that affect devices in the "main" release labels Jul 30, 2021
@nrser nrser added the P3 Nice to have, not working on it for now label Aug 4, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug P3 Nice to have, not working on it for now release: main Issues that affect devices in the "main" release
Projects
None yet
Development

No branches or pull requests

2 participants