(err, message, dispatch)
| 191 | } |
| 192 | |
| 193 | export function handleAsyncError(err, message, dispatch) { |
| 194 | // Handle html error responses |
| 195 | if (err && typeof err.text === 'function') { |
| 196 | err.text().then(text => { |
| 197 | const error = {message, html: text}; |
| 198 | dispatch(onError({type: 'backEnd', error})); |
| 199 | }); |
| 200 | } else { |
| 201 | const error = err instanceof Error ? err : {message, html: err}; |
| 202 | dispatch(onError({type: 'backEnd', error})); |
| 203 | } |
| 204 | } |
no test coverage detected
searching dependent graphs…