Upgrade dependencies, fix directory download errors

Related to #106
This commit is contained in:
Bruno Bernardino
2025-10-08 14:38:31 +01:00
parent c4a5166e3b
commit 8d78e1f25c
6 changed files with 11 additions and 7 deletions

View File

@@ -51,7 +51,9 @@ export const handler: Handlers<Data, FreshContextState> = {
if (code !== 0) {
const errorText = new TextDecoder().decode(stderr);
console.error('Zip command failed:', errorText);
return new Response('Error creating zip archive', { status: 500 });
}
@@ -65,9 +67,11 @@ export const handler: Handlers<Data, FreshContextState> = {
});
} catch (error) {
console.error('Error creating directory zip:', error);
if (error.message === 'Invalid file path') {
if ((error as Error).message === 'Invalid file path') {
return new Response('Invalid directory path', { status: 400 });
}
return new Response('Error creating zip archive', { status: 500 });
}
},