We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 42727a9 commit 134d56fCopy full SHA for 134d56f
src/utils/request.js
@@ -82,7 +82,11 @@ export const uploadFile = (formData, callback) => {
82
}
83
else if (uploadFileXHR.status !== 200) {
84
if (typeof callback != "function") return;
85
- callback(JSON.parse(uploadFileXHR.responseText));
+ try {
86
+ callback(JSON.parse(uploadFileXHR.responseText));
87
+ } catch (ex) {
88
+ callback(ex);
89
+ }
90
91
};
92
uploadFileXHR.send(formData);
0 commit comments