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' }
]
}
如何我举个例子,扔富和酒吧错误?