You can completely control program flow and generate the user define error messages.
In following example we use error constructor to create an Error object. Error object throw exception when errors occur during program execution.
You can define and initialize new object when you throw an object. Object parameters are assign to a object properties, later that properties reference use in catch block.
In following example create