mirror of
https://github.com/tdurieux/anonymous_github.git
synced 2026-02-12 18:32:44 +00:00
improve error handling during anonymization
This commit is contained in:
@@ -116,13 +116,17 @@ router.post("/:repoId/", async (req, res) => {
|
||||
await repoUtils.updateStatus(repoConfig, "preparing");
|
||||
|
||||
res.send("ok");
|
||||
|
||||
} catch (error) {
|
||||
console.error(req.path, error);
|
||||
await repoUtils.updateStatus(repoConfig, "error", error);
|
||||
return res.status(500).json({ error });
|
||||
}
|
||||
try {
|
||||
await githubUtils.downloadRepoAndAnonymize(repoConfig);
|
||||
await repoUtils.updateStatus(repoConfig, "ready");
|
||||
} catch (error) {
|
||||
console.error(req.path, error);
|
||||
await repoUtils.updateStatus(repoConfig, "error", error);
|
||||
return res.status(500).json({ error });
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
Reference in New Issue
Block a user