Java Interview Shorts 21 - Realtime use-case of re throwing an exception

preview_player
Показать описание
In this video, we will learn the advantages of re throwing an exception in java and when should we use this.

When it comes to java exception handling, we are not going to handle the exception wherever it occurs all the time. sometime we may need to convert an exception to another type and then throw it to the calling method.
Рекомендации по теме
Комментарии
Автор

Imagine, if you have a db error which exposes the table columns or a specific library exception that you don't want to expose to the calling method, in that case converting an exception to a more Generic Type can really helps. In that way you are giving more understandable exceptions to the calling method and abstracting out the actual exceptions. The calling method can further handle the exception according to the business logic.

SeleniumExpress
Автор

Thank you abhilash. Please I'm waiting for the remaining parts of the microservices course

ophemtech
Автор

Ye baba, indian ahes na mg nit bol na, ky la ya n vyan kartuy

aishwaryajadhav
Автор

Sir. Can i get your Instagram id to ask doubts. Pls🙏

lakshminathanrd