ADD more error handling

This commit is contained in:
2025-06-05 19:41:03 +02:00
parent e2eb9b365a
commit 7f829a70e1
2 changed files with 24 additions and 1 deletions

View File

@@ -20,8 +20,11 @@ public class UploadController {
@PostMapping()
public ResponseEntity<String> uploadVideo(@RequestParam("file") MultipartFile file) {
String uuid = uploadService.upload(file);
if (file == null || file.isEmpty()) {
throw new IllegalArgumentException("Invalid file");
}
String uuid = uploadService.upload(file);
return new ResponseEntity<>(uuid, HttpStatus.OK);
}
}