rowanwins / vue-dropzone

A Vue.js component for Dropzone.js - a drag’n’drop file uploads utility with image previews
https://rowanwins.github.io/vue-dropzone/docs/dist
MIT License
2.02k stars 1.4k forks source link

Get error message in json response #618

Open Sh1ftOo opened 2 years ago

Sh1ftOo commented 2 years ago

I have flask backend and generate return jsonify({'message': 'error'}, 500)

vue-dropzone doesn't get or see this response with status 500 and message

But if I write only status code return 500 without jsonify vue-dropzone understand that he gets error status code

How do I process json message with status code and show into the error box in vue-dropzone?

My dropzoneOptions:

dropzoneOptions: {
              url: axios.defaults.baseURL + '/images/upload',
              headers: { Authorization: `Bearer: ${ localStorage.getItem('token')}` },
              acceptedFiles: "image/*, .png,.jpg,.jpeg,.JPG,.heic",
              paramName: 'file',
              thumbnailWidth: 150,
              maxFilesize: 30,
              parallelUploads: 4
            }