mirror of
https://github.com/transloadit/uppy.git
synced 2026-07-17 16:50:22 +00:00
core: provide default error message (#1880)
We were already doing `if (file.error)` in places, now that is guaranteed to work even if the error message was empty or the error object is custom and doesn't have a `.message` property.
This commit is contained in:
parent
d3e8779d36
commit
50bbeb0245
1 changed files with 2 additions and 2 deletions
|
|
@ -783,12 +783,12 @@ class Uppy {
|
|||
*/
|
||||
_addListeners () {
|
||||
this.on('error', (error) => {
|
||||
this.setState({ error: error.message })
|
||||
this.setState({ error: error.message || 'Unknown error' })
|
||||
})
|
||||
|
||||
this.on('upload-error', (file, error, response) => {
|
||||
this.setFileState(file.id, {
|
||||
error: error.message,
|
||||
error: error.message || 'Unknown error',
|
||||
response
|
||||
})
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue