Computer Science, asked by divyadommata204, 1 month ago

Kiran needs help in following the rules that must be followed while creating exception handling strategy. Which rules he must consider from below list ?
Select one or more:
a. Think of a strategy for logging exceptions.
b. Differentiate between application business and technical exceptions.
c. Create meaningful exception messages.
d. Delay till testing to rectify an incorrect exception.

Answers

Answered by rakhigupta945298
2

Answer:

the answer is a

Explanation:

hope you like it

Answered by KailashHarjo
0

Kiran must consider all of the given rules while creating an exception handling strategy.

  • Logging of exceptions is not a good option, we might use one or more methods that throw exceptions, or we might be the exception ourself. This implies that we might not make it to the try block's end. We won't shut down the resources as a result. The final block or a try-with-resource statement should therefore contain all of your cleanup code.
  • The better the exception you throw, the more specific it is. Make sure to always give them as much information as you can. Your API is now simpler to understand as a result. And as a result, the person calling your method will be in a better position to handle the exception or prevent it altogether by adding another check.
  • Everyone who needs to know what happened when the exception was reported in the log file or your monitoring tool reads the exception's message. Therefore, it should give the most accurate description of the issue and offer the most pertinent details to comprehend the exceptional event.
  • Sometimes it's preferable to catch a common exception and then wrap it in a unique one. An application- or framework-specific business exception is a common illustration of this type of exception. This enables you to add more details and implement a unique handling for your exception class.

To learn more:

https://brainly.in/question/7577677

https://brainly.in/question/6206082

#SPJ2

Similar questions