1 回答
TA贡献1831条经验 获得超4个赞
我需要另一个等待来读取错误:
/**
* EPICOR invoke ODATA Post command
* @param {string} serviceBO - Busines Object that provides service
* @param {string} args - the ODATA command and any arguments
* @param {json} payload - and data to send in POST
* @return {string} The next job number
* @public
*/
const post = (async (serviceBO, args, payload) => {
let reply = {}
const url = SERVERURL + serviceBO
const options = window.STORE.getState().identity.options
try {
reply = await o(url, options).post(args, payload).query()
} catch (error) {
console.log(`Error Code: ${error.status}`)
console.log(`Error URL: ${error.url}`)
const json = await error.json()
const body = JSON.stringify(json, ' ', 4)
console.log(`Error body: ${body}`)
return error
}
return reply
})
添加回答
举报