mirror of
https://github.com/tdurieux/anonymous_github.git
synced 2026-07-06 13:47:59 +02:00
chore: improve error handling during anonymization
This commit is contained in:
@@ -7,6 +7,7 @@ import storage from "./storage";
|
|||||||
import config from "../config";
|
import config from "../config";
|
||||||
import { anonymizePath, anonymizeStream } from "./anonymize-utils";
|
import { anonymizePath, anonymizeStream } from "./anonymize-utils";
|
||||||
import AnonymousError from "./AnonymousError";
|
import AnonymousError from "./AnonymousError";
|
||||||
|
import { handleError } from "./routes/route-utils";
|
||||||
|
|
||||||
function tree2sha(
|
function tree2sha(
|
||||||
tree: any,
|
tree: any,
|
||||||
@@ -174,8 +175,7 @@ export default class AnonymizedFile {
|
|||||||
});
|
});
|
||||||
s.pipe(res);
|
s.pipe(res);
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
console.log("Error during anonymization", error);
|
handleError(error, res);
|
||||||
res.status(500).send({ error: error.message });
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user