mirror of
https://gitcode.com/gh_mirrors/hy/Hydro.git
synced 2026-10-20 01:38:19 +08:00
core: import: handle error message for invalid zip
This commit is contained in:
1 parent
cb424c9cac
commit
895d50530a
4 files changed
+24
-4
No files matched your search
@@ -111,7 +111,12 @@ class FpsProblemImportHandler extends Handler {
|
||||
} catch (e) {
|
||||
if (e instanceof FileTooLargeError) throw e;
|
||||
console.log(e);
|
||||
const zip = new AdmZip(this.request.files.file.filepath);
|
||||
let zip: AdmZip;
|
||||
try {
|
||||
zip = new AdmZip(this.request.files.file.filepath);
|
||||
} catch (e) {
|
||||
throw new ValidationError('zip', null, e.message);
|
||||
}
|
||||
for (const entry of zip.getEntries()) {
|
||||
try {
|
||||
const buf = entry.getData();
|
||||
|
||||
Reference in new issue
Block a user