Merge pull request #5026 from betagouv/js-return-true-errors
javascript: make DirectUpload errors return true error objects
This commit is contained in:
commit
b022a26db5
1 changed files with 4 additions and 4 deletions
|
@ -15,10 +15,10 @@ export default class Uploader {
|
||||||
this.progressBar.start();
|
this.progressBar.start();
|
||||||
|
|
||||||
return new Promise((resolve, reject) => {
|
return new Promise((resolve, reject) => {
|
||||||
this.directUpload.create((error, attributes) => {
|
this.directUpload.create((errorMsg, attributes) => {
|
||||||
if (error) {
|
if (errorMsg) {
|
||||||
this.progressBar.error(error);
|
this.progressBar.error(errorMsg);
|
||||||
reject(error);
|
reject(new Error(errorMsg));
|
||||||
} else {
|
} else {
|
||||||
resolve(attributes.signed_id);
|
resolve(attributes.signed_id);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue