We have the following call to fetch
.
this.http.fetch('flasher', { method: 'post', body: jsonPayload })
.then(response => response.json())
.then(data => console.log(data));
This works when we receive a 200 response but logs nothing to the console when we receive a 500 response. How do we handle a 500?
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…