diff --git a/mccs-it/thermal/app.js b/mccs-it/thermal/app.js index f72a271..f481840 100644 --- a/mccs-it/thermal/app.js +++ b/mccs-it/thermal/app.js @@ -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 }); } });