You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Sorry not following the issue reporting instruction but this one is a simple error happening here
If the backend response payload=null (I know it shouldn't) and because Javascript consider the "null" as an object it throws error when trying resolve "payload.errors"
Indeed it passes through the guard that I think it's provided to prevent this kind of errors.
if (this.isSuccess(status, headers, payload)) {
return payload;
} else if (this.isInvalid(status, headers, payload)) {
return new InvalidError(typeof payload === 'object' && 'errors' in payload ? payload.errors : undefined);
}
The text was updated successfully, but these errors were encountered:
@snewcomer
Not really I don't have PR as I'm not sure where is the right place to consolidate this guard.
But I can imagine something like bellow code which payload && added may works.
return new InvalidError(payload && typeof payload === 'object' && 'errors' in payload ? payload.errors : undefined);
Sorry not following the issue reporting instruction but this one is a simple error happening here
If the backend response payload=null (I know it shouldn't) and because Javascript consider the "null" as an object it throws error when trying resolve "payload.errors"
Indeed it passes through the guard that I think it's provided to prevent this kind of errors.
The text was updated successfully, but these errors were encountered: