appwrite / sdk-for-web

[READ-ONLY] Official Appwrite Web SDK 🧡

Home Page:https://appwrite.io

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Unable to get the Response Error

eladcandroid opened this issue · comments

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

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.

I was search the docs for this exact issue. 👍

New error format for the JS SDK:
image

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

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

Can I work on thiis issue?

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

Fixed on Appwrite Web SDK 2.0