Skip to content

How to read 400 - Bad Request JSON response with useAsync onReject ? #232

Open
@ghost

Description

Hello,

I'm struggling to get the error JSON response from a useAsync passing through onReject.

const { isPensing } = useAsync({ promiseFn: myFunction, onResolve: (data) => { console.log(data }, onReject: (error) => { // read Bad Request JSON response } })

The JSON Response I would like to read is:
{"id":"7282782728272827","status":"subscribed"}

Any idea ?
Thank you!

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