Why error handling? While we are executing code, we might encounter lots of errors including javascript error, system error or API returned error. Once the error occurs and we didn’t handle it properly, it will terminate code execution. In some scenarios we don’t want our code to terminate, we should…