mirror of
https://github.com/transloadit/uppy.git
synced 2026-07-25 11:14:05 +00:00
return empty response and log error if failed to parse JSON
This commit is contained in:
parent
af5d544488
commit
097940e6ae
1 changed files with 4 additions and 2 deletions
|
|
@ -45,12 +45,14 @@ module.exports = class XHRUpload extends Plugin {
|
|||
* @param {XMLHttpRequest | respObj} responseObject the response object
|
||||
*/
|
||||
getResponseData (responseContent, responseObject) {
|
||||
let response = {}
|
||||
try {
|
||||
return JSON.parse(responseContent)
|
||||
response = JSON.parse(responseContent)
|
||||
} catch (err) {
|
||||
this.uppy.log(err, 'error')
|
||||
return err
|
||||
}
|
||||
|
||||
return response
|
||||
},
|
||||
/**
|
||||
*
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue