chore: improve error handling during anonymization

This commit is contained in:
tdurieux
2021-09-07 07:22:42 +02:00
parent 6679a03b2b
commit f0788810a9
+2 -2
View File
@@ -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 });
} }
} }
} }