.
This commit is contained in:
parent
73db7c0e65
commit
6a6bb1c99d
@ -26,16 +26,16 @@ app.post('/print-credentials', async (req, res) => {
|
||||
Thermal.print().then(res => {
|
||||
res.send('PDF sent to printer successfully.');
|
||||
}).catch(e => {
|
||||
console.error('Failed to start printing process:', err);
|
||||
res.status(500).json({ message: 'Failed to start printing process', error: err.message });
|
||||
console.error('Failed to start printing process:', e);
|
||||
res.status(500).json({ message: 'Failed to start printing process', error: e.message });
|
||||
});
|
||||
}).catch(e => {
|
||||
console.error(e);
|
||||
res.status(500).json({ message: 'Error writing PDF file', error: err.message });
|
||||
res.status(500).json({ message: 'Error writing PDF file', error: e.message });
|
||||
});
|
||||
} catch (error) {
|
||||
console.error('Print Error:', error);
|
||||
res.status(500).json({ message: 'Print Error', error: error.message });
|
||||
} catch (e) {
|
||||
console.error('Print Error:', e);
|
||||
res.status(500).json({ message: 'Print Error', error: e.message });
|
||||
}
|
||||
});
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user