Skip to content

Commit c7b6a3d

Browse files
author
Saurabh Kumar Bajpai
committed
fix: handle promise rejections with .catch()
1 parent af173a5 commit c7b6a3d

1 file changed

Lines changed: 1 addition & 0 deletions

File tree

‎frontend/js/book-preview.js‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -209,6 +209,7 @@ const BookPreview = (() => {
209209
el.querySelector('#download-card-btn').addEventListener('click', () => {
210210
const card = document.getElementById('book-card');
211211
html2canvas(card).then(canvas => {
212+
.catch(err => console.error(err))
212213
const link = document.createElement('a');
213214
link.download = 'book-card.png';
214215
link.href = canvas.toDataURL('image/png');

0 commit comments

Comments
 (0)