Tanks for the tip! Creating the CheckedBiConsumer does the trick indeed. I can't use the second one because the code I'm extending already defines that I need to return a standard Runnable though, but that's not a problem.
For further actions, you may consider blocking this person and/or reporting abuse
We're a place where coders share, stay up-to-date and grow their careers.
You can define your own BiConsumer interface that throws checked exceptions as follows:
And also define a CheckedRunnable that propagates the exception thrown by the CheckedBiConsumer:
That way you can leave it up to the code executing the runnable what to do with the checked exception.
Tanks for the tip! Creating the CheckedBiConsumer does the trick indeed. I can't use the second one because the code I'm extending already defines that I need to return a standard
Runnable
though, but that's not a problem.