Javers Spring support uses JaversAuditableRepositoryAspect on Spring-Data @Repository classes for @JaversAuditable or the Spring-Data CrudRepository interface. If an exception is thrown from one of those methods, then JaversAuditableRepositoryAspect, which uses @After will still execute and try and perform a versioning. According to Spring AOP Docs, @After will always execute, regardless of if there was an exception thrown or not. @AfterReturning instead executes only if the method returns normally.
Here's the original StackOverflow question for reference.
Javers Spring support uses JaversAuditableRepositoryAspect on Spring-Data
@Repositoryclasses for@JaversAuditableor the Spring-DataCrudRepositoryinterface. If an exception is thrown from one of those methods, then JaversAuditableRepositoryAspect, which uses@Afterwill still execute and try and perform a versioning. According to Spring AOP Docs,@Afterwill always execute, regardless of if there was an exception thrown or not.@AfterReturninginstead executes only if the method returns normally.Here's the original StackOverflow question for reference.