This commit is contained in:
Skylar Grant 2024-09-12 13:42:43 -04:00
parent 73db7c0e65
commit 6a6bb1c99d

View File

@ -26,16 +26,16 @@ app.post('/print-credentials', async (req, res) => {
Thermal.print().then(res => { Thermal.print().then(res => {
res.send('PDF sent to printer successfully.'); res.send('PDF sent to printer successfully.');
}).catch(e => { }).catch(e => {
console.error('Failed to start printing process:', err); console.error('Failed to start printing process:', e);
res.status(500).json({ message: 'Failed to start printing process', error: err.message }); res.status(500).json({ message: 'Failed to start printing process', error: e.message });
}); });
}).catch(e => { }).catch(e => {
console.error(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) { } catch (e) {
console.error('Print Error:', error); console.error('Print Error:', e);
res.status(500).json({ message: 'Print Error', error: error.message }); res.status(500).json({ message: 'Print Error', error: e.message });
} }
}); });