We're sorry Aspose doesn't work properply without JavaScript enabled.

Free Support Forum - aspose.com

Expected unreported exceptions in Aspose Words

Hi,

On upgrading Aspose Words library from version 13.10.0 to version 14.11.0. I am getting compile time error at a lot of places.
Error:
unreported exception Exception; must be caught or declared to be thrown

Code:
border.setColor(BORDER_COLOR);

Simple solution will be just to wrap it in try catch block. But I am getting this error almost everywhere, wherever Aspose Words code is used. This error was not there in Aspose Words version 13.10.0. And the methods which expects Exception handling are not declared to throw exception in the documentation.
For e.g. https://reference.aspose.com/words/java/com.aspose.words/border#Color

Can you please verify, if this is expected?

Thanks,

Hi Tarun,

Thanks for your inquiry. You need to surround the code with try/catch block or add throws declaration for your method. See the attached image for detail. I suggest you please read about migrating from earlier version of Aspose.Words from here:
https://docs.aspose.com/words/java/
https://docs.aspose.com/words/java/