mirror of
https://github.com/tdurieux/anonymous_github.git
synced 2026-07-10 07:28:36 +02: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");
|
await repoUtils.updateStatus(repoConfig, "preparing");
|
||||||
|
|
||||||
res.send("ok");
|
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 githubUtils.downloadRepoAndAnonymize(repoConfig);
|
||||||
await repoUtils.updateStatus(repoConfig, "ready");
|
await repoUtils.updateStatus(repoConfig, "ready");
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
console.error(req.path, error);
|
console.error(req.path, error);
|
||||||
await repoUtils.updateStatus(repoConfig, "error", error);
|
await repoUtils.updateStatus(repoConfig, "error", error);
|
||||||
return res.status(500).json({ error });
|
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user