OnErrorContinue throws already handled Exceptions

See original GitHub issue

I am using reactor with MongoDB and when saving to Mongo I get the following exception when using OnErrorContinue

org.springframework.transaction.reactive.TransactionContextManager$NoTransactionInContextException: No transaction in context

However, the data has been saved correctly in MongoDB. It seems that already handled Exceptions are still being catch by onErrorContinue.

I found the following link describing that behaviour. https://github.com/spring-projects/spring-data-r2dbc/issues/211

My question is, what is the semactic of onErrorContinue? Should it received already handled exceptions? Is it a bug? I could not find any description of onErrorContinue on the documentation.

Expected Behavior

Already handled Exception should not be handled by onErrorContinue

Actual Behavior

Actually onErrorContinue is getting already handled Exceptions.

Steps to Reproduce

        mongoRepository
                .save(data)
                .onErrorContinue { e, _ -> logger.warn("Error saving data to repository: $e") }


Then code above prints the following error: org.springframework.transaction.reactive.TransactionContextManager$NoTransactionInContextException: No transaction in context

Although, the data is being saved in MongoDB.

Possible Solution

Your Environment

  • Reactor version(s) used: reactor-core 3.3.2
  • Other relevant libraries versions (eg. netty, …):
  • JVM version (javar -version): 1.8
  • OS and version (eg uname -a): Linux Ubuntu 18

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:8 (5 by maintainers)

github_iconTop GitHub Comments

9reactions
bradfordChiangcommented, May 26, 2020

I’m having same issue here

2reactions
mp911decommented, Jun 3, 2020

NoTransactionInContextException isn’t an error, it’s the signal Spring’s transaction infrastructure uses to signal that no transaction is in progress.

Read more comments on GitHub >

github_iconTop Results From Across the Web

When and how to use onErrorContinue(): Reactor FAQ
This means retrying may produce the same events that we already processed, or miss some events. It depends on how the initial stream...
Read more >
Reactive Programming (Reactor)- Part 3- Errors handling
Reactor offers a number of operators to handle exceptions and errors. ... an exception will be thrown, onErrorContinue will make sure that ...
Read more >
How to handle errors in Spring reactor Mono or Flux?
Now, when it encounters kyle the checked exception is throws and MIKE is returned from onErrorReturn. @Test void Test19() { Flux.
Read more >
Daily Reactive: Where is my exception?!
Throwing an error is a very easy way of terminating the processing. ... An example of such is Project Reactor's onErrorContinue() :.
Read more >
Project Reactor - Error Handling Examples - Woolha
Using doOnError. doOnError will be executed when an error is thrown and hasn't been caught. If the error has already been caught beforehand, ......
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found