Réorganiser la logique de rendu vidéo pour gérer les erreurs et améliorer la lisibilité du code
This commit is contained in:
@@ -318,11 +318,6 @@ router.post('/videos/render/:video_id', (req, res) => {
|
||||
const pathList = measureManager.getPathList(measurementIds, project_id).then(pathList => {
|
||||
console.log('Path list:', pathList);
|
||||
res.json({ message: 'Render process started' });
|
||||
}).catch(err => {
|
||||
console.error('Error getting path list:', err);
|
||||
res.status(500).json({ error: 'Error getting path list' });
|
||||
});
|
||||
|
||||
const videoFile = videoManager.createVideoWithList(project_id, pathList);
|
||||
console.log('Video file:', videoFile);
|
||||
|
||||
@@ -332,6 +327,10 @@ router.post('/videos/render/:video_id', (req, res) => {
|
||||
console.error('Error updating video file:', err);
|
||||
res.status(500).json({ error: 'Error updating video file' });
|
||||
}
|
||||
}).catch(err => {
|
||||
console.error('Error getting path list:', err);
|
||||
res.status(500).json({ error: 'Error getting path list' });
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
|
||||
Reference in New Issue
Block a user