when must a function throw an exceptiona function


When must a function throw an exception?

A function must throw an exception when it's not able to fulfil its promise.

As soon as function detects a problem which prevents it from fulfilling its promise, it must throw an exception. If function is able to handle problem, recover itself and deliver promise, the exception shouldn't be thrown.

If an event occurs very frequently then exception handling isn't the best way to deal with it. It requires proper fixation.

 

Request for Solution File

Ask an Expert for Answer!!
Software Engineering: when must a function throw an exceptiona function
Reference No:- TGS0354918

Expected delivery within 24 Hours