Topics

Leave a Reply

16 Comments on "Java 8 Lambda Basics 18 – An Exception Handling Approach"

Notify of
avatar

livestupid thinkbrilliant
Guest
livestupid thinkbrilliant
1 month 1 day ago

so even now if the operation is changed and if some other exception happens then it will not be handled and it will be thrown as Unhandled exception… what is the point of wrapper without generic exception being caught..

dhananjay patade
Guest
dhananjay patade
1 month 5 days ago

Nice video,, feel like AOP of java 🙂

Narayan Sampath
Guest
Narayan Sampath
1 month 9 days ago

now my company people will have even more complex looking hard to understand programs to look at unless they move to 1.8 beast mode… ha ha

Anurag Kumar
Guest
Anurag Kumar
2 months 8 days ago

Thanks a lot. Appreciate your effort to bring this to us:)

Rajat Verma
Guest
Rajat Verma
2 months 10 days ago

Lambda Version of Inception Movie 😉

Rahul Kumar
Guest
Rahul Kumar
4 months 28 days ago

This approach holds true in case of runtime exceptions. But this does not work for checked exceptions. I faced this issue while coding for work. Need to reach out to the internet to see how this could be handled.

Guram Kankava
Guest
Guram Kankava
5 months 14 days ago

Thank you very much, its quite hard concept to understand for me watched probably 10 times form 4:40, i think i understood eventually. thank you very much.

LivetoTrance
Guest
LivetoTrance
5 months 17 days ago

Great video Koushia , although i have a doubt… At the last solution for handling exception , you've created this wrapper lambda expression in which you put the try-catch block . However, in the catch you put "Arithmetic exception" which is specific for the lambda expression in this example, but that wouldn't work for other lambda expression which can throw other type of exception. Is there any full work around for this try-catch situation?

Ed Hye
Guest
Ed Hye
5 days 11 hours ago

It satisfies the question that was asked in that that is how you deal with 'other types of exception'. You would place this control structure in the wrapperLambda that he demonstrated in the video. But it's not particularly satisfying to me either in that it simply places the try/catch structure elsewhere.

cakal9207
Guest
cakal9207
5 days 12 hours ago

This is not satisfying. This is already what we do without lambdas.

Ed Hye
Guest
Ed Hye
5 days 13 hours ago

Just use the superclass Exception, which all exceptions inherit from. Note that if there's specific behaviour you want for some exceptions, but don't care about others, you can catch the specific type first (for example, ArithmeticException), and make the last type Exception. For example the control structure would be:try {…}catch (ArithmeticException e) {…}catch (Exception e) {…}

cakal9207
Guest
cakal9207
8 days 6 hours ago

Have you figured it out?

LivetoTrance
Guest
LivetoTrance
4 months 28 days ago

We'll have to wait for @JAVA_BRAINS to answer hehe

Rahul Kumar
Guest
Rahul Kumar
4 months 28 days ago

Had the same doubt myself. Was wondering if there is a way to pass what exception might occur from the lambda and somehow having the wrapper rely on that to handle the exception.

peter mbanda
Guest
peter mbanda
6 months 30 days ago

Best tutorial hands down Interface iF = () -> System.out.println("Thank You Sir")….Please do a JUNIT video tutorial too.

Rahul Kumar
Guest
Rahul Kumar
4 months 28 days ago

+1 to the Junit tutorial and also design patterns. You are the only one who could simplify the design patterns for the world.

wpDiscuz