How to use returned JSON error in a JavaScript async fetch call

前端 未结 2 1822
粉色の甜心
粉色の甜心 2021-01-27 07:55

I have an async fetch call which calls my backend to create a customer with an email address. If successful, the JSON returned is sent to a doNex

2条回答
  •  北恋
    北恋 (楼主)
    2021-01-27 08:13

    You should be able to get the content using response.json() in the catch handler.

提交回复
热议问题