vue-media-upload
vue-media-upload copied to clipboard
No server error handling?
Hey, I think there should be an event so when the axios request fails, an event is triggered.
Something like: const data = await axios.post(this.server, formData) .catch( error => { this.$emit('serverError', error) });
if( data ){
let addedImage = {url:url, name:data.name, size:files[i].size, type:files[i].type}
this.addedMedia.push(addedImage)
this.$emit('change', this.allMedia)
this.$emit('add', addedImage, this.addedMedia)
}
instead of only: const {data} = await axios.post(this.server, formData)
What do you think?