Error.
Use error.name to determine the error type and handle it accordingly.
Match error.name against the values in the table below whenever you need to handle a specific failure in your app.
You can handle errors using a try-catch block as follows:
Errors
Below are the string values you can match againsterror.name:

