How to catch exceptions in javascript?

后端 未结 4 536
栀梦
栀梦 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:05

    try {
        adoConn.Execute("insert into session (SessionId,Timestamp) values ('"
                         + SessionId + "','" 
                         + SessionCurrenttime + "')");
    } catch(e) {
        /*use error object to inspect the error: e.g. return e.message */
    }
    

提交回复
热议问题