Skip to content

Commit

Permalink
fix(#136): catch & describe errors
Browse files Browse the repository at this point in the history
  • Loading branch information
jannis-baum committed Jul 28, 2024
1 parent 140ad19 commit a1e1797
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/routes/viewer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -52,8 +52,8 @@ router.get(/.*/, async (req: Request, res: Response) => {

body = renderTextFile(data.toString(), path);
}
} catch {
res.status(404).send('File not found.');
} catch (error) {
res.status(500).send(String(error));
return;
}
}
Expand Down

0 comments on commit a1e1797

Please sign in to comment.