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

@atproto/api bluesky client - error 'TypeError: fetch failed' - get more details for industrialization #2786

Open
boly38 opened this issue Sep 4, 2024 · 0 comments

Comments

@boly38
Copy link

boly38 commented Sep 4, 2024

Is your feature request related to a problem? Please describe.

I'm using Bluesky api client in NodeJs especially bsky.feed.searchPosts api
and in some cases (ex. Internet unavailability) I've got as error details TypeError: fetch failed (this is the raw content of the error field)

Out-of-error, I'm unable to get more details than "it failed to fetch"...

Is it transient server unavailability, a rate limit, a transient network issue, a permanent one etc.
And this is frustrating : ex. can I retry or is it useless ? how to explain ?

(client library code side)
Out of known issue (handler), it seems that this is the default error message returned.

NB: at the opposite, a known issue like 400 invalid param is quite well reported as it internally produce BadQueryStringError with clear message, status, error short code 👍

  status: 400,
  error: 'InvalidRequest',
  success: false,`
  message: 'Error: limit can not be less than 1'

Describe the solution you'd like

As API client user, I would like a status (ex. http status like) which could drives my app to take the good business decision :

  • configuration or client issue (partially or maybe already fully handled by known issue)
  • transient issue to retry
  • server side permanent issue,
  • server side transient issue

Describe alternatives you've considered

As alternative solution, I will retry the search X times when I've got the default error message TypeError: fetch failed.
(But this is extra stuff/controls that Bluesky client could/should ideally handle on his own)

Additional context

@boly38 boly38 changed the title @atproto/api cluesky client - error 'TypeError: fetch failed' - get more details for industrialization @atproto/api bluesky client - error 'TypeError: fetch failed' - get more details for industrialization Sep 4, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant