backend error message logging
Gitea Actions Demo / Explore-Gitea-Actions (push) Failing after 41s Details

This commit is contained in:
Ladd Hoffman 2024-03-20 09:41:06 -05:00
parent d7df133991
commit c207fca58e
1 changed files with 8 additions and 1 deletions

View File

@ -29,7 +29,14 @@ app.post('/write', async (req, res) => {
app.get('/read/:hash', async (req, res) => {
// Fetch content
const { hash } = req.params;
const data = await db.get(req.params.hash);
let data;
try {
data = await db.get(req.params.hash);
} catch (e) {
console.log('read error:', e.message, hash);
res.status(e.status).end();
return;
}
console.log('read', hash);
// Return content
res.json(data);