filestack / filestack-js

Official Javascript SDK for the Filestack API and content ingestion system.
https://www.filestack.com
MIT License
206 stars 77 forks source link

[3.x.x] onFileUploadFailed passes File as a second argument but should Error #294

Open lesha1201 opened 4 years ago

lesha1201 commented 4 years ago

According to docs https://filestack.github.io/filestack-js/interfaces/pickerfileerrorcallback.html onFileUploadFailed has two arguments (file: PickerFileMetadata, error: Error) but in version 3.x.x second argument is File. In version 2 everything works as expected.

filestack_error_issue

sshaw commented 1 year ago

Having this problem too. Wondering why my error messages are being output as Some contextual shit: [object Object] and it's because: it's not an Error!

At the very least fix your docs.

sshaw commented 1 year ago

The bigger issue with this bug is: one cannot triage upload failures because... they have no idea why they're failing!

Using this as a workaround which, unfortunately does not have access to the filename:

const uploader = filestack.init(KEY);
uploader.on('upload.error', (error) => {
   // handle error
});