Skip to content

postData/putData/deleteData don't check response.ok server errors silently pass as success #302

@avinxshKD

Description

@avinxshKD

getData in crud_http.js checks response.ok before resolving. The other three don't they just resolve with whatever the server sends back, even on 4xx/5xx. So a failed save or delete looks successful to the rest of the app

Also all four functions wrap fetch() in new Promise() for no reason. If fetch throws (network down), the outer promise just hangs forever since the rejection is never forwarded.

Kill the backend and try saving something, zero error feedback. getData already does the right thing, so this was probably just missed for the write methods.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions