Skip to content

Commit 037c8e8

Browse files
author
zhigang.li
committed
Merge branch '2.0'
2 parents 2c08ea1 + 6106e50 commit 037c8e8

File tree

1 file changed

+10
-1
lines changed

1 file changed

+10
-1
lines changed

src/libs/axios.js

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,16 @@ class HttpRequest {
5151
return { data, status }
5252
}, error => {
5353
this.destroy(url)
54-
addErrorLog(error.response)
54+
let errorInfo = error.response
55+
if (!errorInfo) {
56+
const { request: { statusText, status }, config } = JSON.parse(JSON.stringify(error))
57+
errorInfo = {
58+
statusText,
59+
status,
60+
request: { responseURL: config.url }
61+
}
62+
}
63+
addErrorLog(errorInfo)
5564
return Promise.reject(error)
5665
})
5766
}

0 commit comments

Comments
 (0)