0
我一直在處理在我的react-native/redux應用程序中包含錯誤的對象數組。Redux-Form - 錯誤數組
我有一個用handleResponse功能,看起來是這樣的:
但function handleResponse (response) {
let status = JSON.stringify(response.data.Status)
let res = JSON.stringify(response)
if (Number(status) === 200) {
return res
} else {
throw new SubmissionError('Something happened')
}
}
,而不是作爲參數傳遞給SubmissionError功能通過純文本 - 我想以某種方式從對象的數組取出錯誤。包含錯誤信息的對象
陣列看起來是這樣的:
{
ErrorMessages: [
{ ErrorMessage: 'foo' },
{ ErrorMessage: 'bar' }
]
}
如何我舉個例子,扔富和酒吧錯誤?