我试图在
中发现错误this.$http.post('http://127.0.0.1:8000/api/address/store',address_data,{headers: {'Authorization': 'Bearer ' + this.$auth.getToken()}}).then(response => {
if(response.status == 422) {
console.log('hello')
console.log(response)
}
})
但我不能这样抓住。感谢。
答案 0 :(得分:1)
看起来您正在使用vue-resource来发出ajax请求。我只使用过axios,但是看一下vue-resource的文档看起来像你的错误回调是this.$http.post('/someUrl', [body], [config]).then(successCallback, errorCallback);
的第二个参数
this.$http.post('http://127.0.0.1:8000/api/address/store',address_data,
{headers: {'Authorization': 'Bearer ' + this.$auth.getToken()}})
.then(response => {
// success
}, response => {
//error
if(response.status == 422) {
console.log('hello')
console.log(response)
}
})
# There is insufficient memory for the Java Runtime Environment to continue.
# Native memory allocation (mmap) failed to map 3720347648 bytes for committing reserved memory.
以下是文档的链接:this page