Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Firestore runTransaction doesn't propagate java.lang.Error #3203

@dan-j

Description

@dan-j

If a Transaction.Function<T> lambda throws an instance of java.lang.Error, the returned ApiFuture<T> doesn't trigger the listeners registered through apiFuture.addListener(Runnable, Executor).

I'm wrapping all ApiFuture<T> instances into a Mono<T> from project reactor, and because the listeners don't get fired on Errors my application is just hanging.

As a workaround I've had to wrap my Transaction.Function<T> in a try/catch block to catch Error and rethrow a normal Exception, then catch that from my reactive stream and map it to the original Error.

It would be nice to not have to do this 😊

Metadata

Metadata

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions