Modifier la gestion des erreurs lors de la création de vidéos et commenter le code de test associé

This commit is contained in:
2025-02-12 14:04:28 +01:00
parent 2450359710
commit dcbf2a1f00
2 changed files with 15 additions and 15 deletions

View File

@@ -69,7 +69,7 @@ async function createVideoWithList(projectId, pathList) {
return outputVideo; return outputVideo;
} catch (error) { } catch (error) {
console.error('Error creating video:', error); console.error('Error creating video:', error);
serverError(error); serverError.sendError(error);
} finally { } finally {
// Supprimer le fichier temporaire // Supprimer le fichier temporaire
if (fs.existsSync(tempFile)) { if (fs.existsSync(tempFile)) {

View File

@@ -37,20 +37,20 @@ function getCatVideo() {
// // console.error('Error:', err); // // console.error('Error:', err);
// // }); // // });
var pathList = [ // var pathList = [
'storage/1/images/1.jpg', // 'storage/1/images/1.jpg',
'storage/1/images/10.jpg', // 'storage/1/images/10.jpg',
'storage/1/images/20.jpg', // 'storage/1/images/20.jpg',
'storage/1/images/30.jpg', // 'storage/1/images/30.jpg',
]; // ];
videoManager.createVideoWithList(1, pathList).then(res => { // videoManager.createVideoWithList(1, pathList).then(res => {
console.log('3 - Video created:', res); // console.log('3 - Video created:', res);
return storageManager.deleteFile(res); // return storageManager.deleteFile(res);
}).then(res => { // }).then(res => {
console.log('4 - Video deleted:', res); // console.log('4 - Video deleted:', res);
}).catch(err => { // }).catch(err => {
console.error('Error:', err); // console.error('Error:', err);
}); // });
exports.getSmileImage = getSmileImage; exports.getSmileImage = getSmileImage;
exports.getCatVideo = getCatVideo; exports.getCatVideo = getCatVideo;