I recently migrated my Java application from using javax.mail:mail version 1.5.0-b01 to jakarta.mail:jakarta.mail-api version 2.1.2. However, I've encountered an issue regarding exception handling that I need some help with.
In my previous implementation, I was using com.sun.mail.iap.ParsingException from the javax.mail package. This exception was crucial in handling specific parsing errors related to mail protocols. After switching to the newer jakarta.mail:jakarta.mail-api, I found that com.sun.mail.iap.ParsingException is no longer available.
The available packages in jakarta.mail are event, internet, search, and util. I looked into jakarta.mail.internet.ParseException, but it seems to serve a more general purpose and is not a direct replacement for com.sun.mail.iap.ParsingException.
I'm seeking advice on how best to adapt my exception handling to this change. Specifically:
Is there a direct or close equivalent to com.sun.mail.iap.ParsingException in the Jakarta Mail API that I might have overlooked?
If not, what are the recommended practices for handling the specific type of parsing exceptions previously covered by com.sun.mail.iap.ParsingException using the Jakarta Mail API?
Are there any specific patterns or practices in Jakarta Mail for dealing with low-level parsing errors, or should I implement custom error handling?
Any insights, code snippets, or references to relevant documentation would be greatly appreciated. Thank you in advance for your help!
From the Angus Mail COMPAT.txt
So this means that the
com.sun.mail.iap.ParsingExceptionis noworg.eclipse.angus.mail.iap.ParsingException.You should read the JakartaMail COMPAT.txt and the Angus Mail COMPAT.txt (from above) to see what other things have changed between 1.5.0-b01 and 2.1.2. that could impact your code base.