STOP SWALLOWING EXCEPTIONS 🤮

preview_player
Показать описание
Java Exception handling is key for any backend application. In this video I discover this flaw in a code review.

Please never do this.

Don't Forget to
===========================================

🙊 Here are the goods for all my videos video 🙊

► Recommended Books
===========================================

► Computer and Monitor
===========================================

► Camera Gear
=============================================

► IDE & Tools I use for coding 💻 🎒
===========================================
- ITerm
- VsCode
- GoLand
- IntelliJ Ultimate
- Sublime

P.S
===========================================

❤️ Thanks for watching
Рекомендации по теме
Комментарии
Автор

I always tell my juniors never ever swallow exceptions, in rare cases we don't need to rethrow or wrap it. We could just log the error.

praveens
Автор

thank you, your video teaches me using intellij and luckily, the shortcuts are same than pycharm, it is better slowly learning intellij for me than looking at the pdf and i don't forget easily this way

oogway_hussein
Автор

thanks Nelson I actually dropped nodejs back to springboot saving some little fund for your master class you make Java go simple

orionpaul
Автор

STOP SWALLOWING EDITION! IT WAS MUCH BETTER THE OLD WAY

vitormuuniz
Автор

Sometimes we need to handle checked exceptions from an external API and it enforces you to use try-catch Block, i think the appropiate way in this case is retrow the exception. I also agree with the approach of handle exceptions with proper status code.

martingomes
Автор

Hey! Been watching your tutorials since a long time.. Can you make tutorials on reactive programming using spring web flux ?

Asingh
Автор

The starting sequence was hilarious 😂😂

Asingh
Автор

the try and catch was made for the .save method except that method could also throw its exception if it faced error while logging in the database so really there was no need for the try and catch unless the catch had something useful to do which didn't in this case but also sometimes the the handler (try-catch block) is made by force because the .save method can throw an exception therefore the API enforces the rule on you

Take
Автор

Hi Nelson,
Thank you🤝 for the wonderful lessons.

I am a java developer, currently i have been working on one project where I have to process/validate against 50-60 rules, each rule is created as a class due it's complexity. Now these many classes I have to inject into the service class for the processing...

In the service class I am using the switch case to process the desired rule.

Could you please suggest any solid dependency injection pattern or another way here.

Thank you in advance!

sainarsimhaguptathammana
Автор

Grt bro !! Thanks for the suggestions
I am ATG developer from India. Sometimes I do like this.

divakarpandey
Автор

Could you do a demo on this please? very interesting topic.

devoiddude
Автор

The amount of code I've looked at that doesn't swallows exceptions and doesn't use status code or uses it poorly since I started working on the industry is astonishing (and I've been working for 5 months only lol). But not so surprising when I've had to work with APIs that use GET requests to put/post/patch data

lengors
Автор

In a case where the code is unable to save to the DB say a network connection issue or DB is out or down won’t the try catch come in handy. Or does he/she check at every instance if the DB connection is up/accessible before saving into it.

somebodyoulove
Автор

1:56 Could you please tell us why the try-catch is not needed when there is no checked exception? What if the persistence fails?

centfox
Автор

He might be hungry. So he swallowed the whole exception😂❤

ranjanpandey
Автор

separate video on exception handling will be appreciated

vidhya
Автор

Guys Interview question for you: Why there is no cheched exception here, do we need, what about SQLException?

caffeinejavacode
Автор

What about an exception thrown in a secundairy non-business critical process? Thow it upstream and catch it at the uppermost service level?

khazsilverstar
Автор

I'm not familiar with java. But shouldn't be checked for insertion error?

Does the JPA automatically throws an error?

rrrel
Автор

it's okay because client side code can handle the returned value

jamalkb