Skip to content

Commit

Permalink
fix reject promise
Browse files Browse the repository at this point in the history
  • Loading branch information
victorqribeiro committed Oct 10, 2018
1 parent 59108f3 commit 9d58c79
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions src/imgToAscii.js
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ class imgToAscii {
this.string = "";
this.stringColor = "";
this.imageSrc = image;
this.loadImage = new Promise( resolve =>{
this.loadImage = new Promise( (resolve,reject) =>{
this.image = new Image();
this.image.src = this.imageSrc;
this.image.onload = ()=> {
Expand Down Expand Up @@ -67,8 +67,9 @@ class imgToAscii {
}
}
resolve();
}
});
};
this.image.error = reject;
}).catch( e => console.error(e) );
}

async display(){
Expand Down

0 comments on commit 9d58c79

Please sign in to comment.