In the following code I'm able to catch the exception and print it but for some reason my program breaks there and it makes me to restart the application. Can't I handle it gracefully with out restarting it?
var checkRecordId = function (recordId)
{
if (recordId < 0)
throw new Error ("Record Id can not be 0 or less");
}
var getReport = function (dateRange , recordId)
{
try
{
checkRecordId (recordId);
}
catch (err)
{
console.log (err);
}
}