How to catch exceptions in javascript?

后端 未结 4 535
栀梦
栀梦 2020-12-10 03:44

I want to catch exceptions in javascript if an insertion query is not done.

I have written the code below:

var adoConn = new ActiveXObject(\"ADODB.Co         


        
4条回答
  •  醉酒成梦
    2020-12-10 04:16

    To be complete, here's the full structure

    try {
      // your code that can throw exception goes here
    } catch(e) {
      //do stuff with the exception
    } finally {
      //regardless if it worked or not, do stuff here (cleanup?)
    }
    

提交回复
热议问题