Skip to content

Commit 7f15c1a

Browse files
authored
Merge pull request #14 from imtheknown/master
Added promise reject function on error in onload function
2 parents afceb1c + 2eabfcc commit 7f15c1a

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

index.js

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
12
/**
23
* EasyQRCodeJS-NodeJS
34
*
@@ -1186,6 +1187,9 @@ Drawing.prototype.draw = function(oQRCode) {
11861187

11871188
drawQrcode.call(t, oQRCode);
11881189
}
1190+
bgImg.onerror = function(e){
1191+
t.reject(e);
1192+
}
11891193
bgImg.src = _htOption.backgroundImage;
11901194
// DoSomething
11911195
} else {
@@ -1795,4 +1799,4 @@ QRCode.prototype.toSVGText = function() {
17951799
*/
17961800
QRCode.CorrectLevel = QRErrorCorrectLevel;
17971801

1798-
module.exports = QRCode;
1802+
module.exports = QRCode;

0 commit comments

Comments
 (0)