javascript - How to get the context of a Web Sql error? -


i start deploying offline application on iphones, it's still under heavy developpment. have simple error handler query :

db.transaction(tx) {     tx.executesql("select * table",[], successhandler, errorhandler); }); function errorhandler(transaction, error) {     alert("error : " + error.message); } 

when test myself application, , error, manage find query generating error. when it's users (distant users, of course), it's difficult, error messages not specific.

is there way add context info error messages, example sql query, or comment parameter ?

you use pattern this:

  db.transaction(tx) {     doquery(tx, "select * table",[],thesuccesshandler)   });    function doquery(tx, query, values, successhandler) {     tx.executesql(query, values, successhandler, errorhandler);     function errorhandler(transaction, error) {         alert("error : " + error.message + " in " + query);     }   } 

Comments

Popular posts from this blog

android - java.net.UnknownHostException(Unable to resolve host “URL”: No address associated with hostname) -

jquery - How can I dynamically add a browser tab? -

keyboard - C++ GetAsyncKeyState alternative -