Hi @Matti
Well, I’m writing to you directly because I understand that you’re the developer of this class, from Viritin itself, hehe…
I just have this here.
When I upload an .mp4 file, which I have as an unsupported file, it jumps to the catch
but when that exception is triggered, the
return new UploadFileHandler((InputStream inputStream, UploadFileHandler.FileDetails metadata) -> {
try (final FastByteArrayOutputStream fastOutputStream = new FastByteArrayOutputStream()) {
if (SupportFilesEnum.fromExtension(FileUtils.getFileExtension(metadata.fileName())) == SupportFilesEnum.UNKNOWN) {
throw new IllegalArgumentException("File not supported!");
}
String fileName = metadata.fileName();
if (this.decompressionService.isCompressedFile(fileName)) {
List<DecompressedFile> files = this.decompressionService.decompressFile(fileName, inputStream);
files.forEach(decompressedFile -> {
this.executeUI(() -> this.processFile(metadata, decompressedFile.content(), true, decompressedFile));
});
} else {
inputStream.transferTo(fastOutputStream);
byte[] bytes = fastOutputStream.toByteArray();
this.executeUI(() -> {
this.processFile(metadata, bytes, false, new DecompressedFile(null, null, 0L));
});
}
return () -> {
this.uploader.clearFileList();
this.searchPopover.updateItems(this.getXsdXmlFiles());
};
} catch (Exception error) {
return () -> {
log.error("Error catch uploader: {}", error.getMessage());
Notification.show("Upload failed: " + error.getMessage(),
2000, Notification.Position.MIDDLE)
.addThemeVariants(NotificationVariant.LUMO_WARNING);
this.uploader.clearFileList();
};
}
})
.withClearAutomatically(true)
.withAddedClassName("upload-xml-xsd", LumoUtility.Padding.XSMALL, LumoUtility.Width.FULL,
LumoUtility.Margin.Right.MEDIUM, LumoUtility.Margin.Left.NONE)
.withDragAndDrop(true)
.withDropLabelIcon(new Span())
.withDropLabel(new Span("Drop files here, only support: " + XsdValidatorConstants.SUPPORT_FILES))
.withUploadButton(attachment);
Notification.show(“Upload failed: ” + error.getMessage(),
2000, Notification.Position.MIDDLE)
.addThemeVariants(NotificationVariant.LUMO_WARNING);
It notifies approximately 6 times.
2026-01-29T19:23:05.705+01:00 ERROR 2284174 --- [nio-8888-exec-4] com.rubn.xsdvalidator.view.Input : Error catch uploader: File not supported!
2026-01-29T19:23:06.245+01:00 ERROR 2284174 --- [nio-8888-exec-7] com.rubn.xsdvalidator.view.Input : Error catch uploader: File not supported!
2026-01-29T19:23:06.440+01:00 ERROR 2284174 --- [nio-8888-exec-9] com.rubn.xsdvalidator.view.Input : Error catch uploader: File not supported!
2026-01-29T19:23:06.568+01:00 ERROR 2284174 --- [nio-8888-exec-3] com.rubn.xsdvalidator.view.Input : Error catch uploader: File not supported!
2026-01-29T19:23:06.727+01:00 ERROR 2284174 --- [nio-8888-exec-8] com.rubn.xsdvalidator.view.Input : Error catch uploader: File not supported!
2026-01-29T19:23:07.028+01:00 ERROR 2284174 --- [nio-8888-exec-5] com.rubn.xsdvalidator.view.Input : Error catch uploader: File not supported!