appwrite / sdk-for-web

[READ-ONLY] Official Appwrite Web SDK 🧡
https://appwrite.io
BSD 3-Clause "New" or "Revised" License
273 stars 59 forks source link

Unable to get the Response Error #7

Closed eladcandroid closed 3 years ago

eladcandroid commented 4 years ago

You just reject with the request.responseText, here: https://github.com/appwrite/sdk-for-js/blob/3f71ea130d6c91ea484f9de821a9ec74345d4160/src/sdk.js#L214

What about the cases when we want to get the error message? For example: {"message":"Too many requests","code":429,"version":"0.6.2"}

Maybe you should add a case and send request.response when it exists..

eldadfux commented 4 years ago

Thanks for the feedback Elad! This definitely make sense.

This is a breaking change so will try to schedule it with version 0.7 of the Appwrite server which should introduce some breaking changes to the SDKs anyway.

delaneyj commented 4 years ago

I was search the docs for this exact issue. :+1:

eldadfux commented 4 years ago

New error format for the JS SDK: image

delaneyj commented 4 years ago

Awesome... Is there a way to avoid or turnoff the first 401 logging?

eldadfux commented 4 years ago

Only by hiding network errors from your own console. More info on this can be found here: https://stackoverflow.com/questions/41515732/hide-401-console-error-in-chrome-dev-tools-getting-401-on-fetch-call

eldadfux commented 4 years ago

Fix has been committed: https://github.com/appwrite/sdk-generator/commit/1f35db85cfb4946c3e1a98499049c0d8a61bb23b

naman360 commented 3 years ago

Can I work on thiis issue?

eldadfux commented 3 years ago

Hey @naman360 this issue has already been fixed. We'll release a new version with the release of Appwrite 0.7

eldadfux commented 3 years ago

Fixed on Appwrite Web SDK 2.0