我正在使用node-wpapi,它使用了promises并且我发现catch(error)
出错。
问题是,虽然在浏览器中我看到了确切的错误消息,但是catch报告了一个更通用的错误。
例如:如果我进入Chrome "request has been blocked by CORS policy"
,并且抓住了,我得到的是“ Request has been terminated, Possible causes: the network is offline, Origin is not allowed by Access-Control-Allow-Origin, the page is being unloaded, etc."
。
有没有办法从catch中读取确切的错误消息?