angularjs - Very uninformative error with SQLite query -


i'm using apache cordova hybrid mobile application platform. i'm using following plugin cordova-sqlite-storage handling sqlite. syntax identical of websql.

considering used angularjs have database set in factory, here how i've called query ran against database without problems:

    query: function(query, params, callback) {         try {             factory.database.transaction(function(tx) {                 if(callback) tx.executesql(query, params, callback, function(transaction, error) { console.log("error"); });                 else tx.executesql(query,params);             });         } catch (e) {             console.log("error: ", json.stringify(e));         }     } 

however today, changed. please note "error" callback not present, in case not fire anyway.

so issues follows:

  1. the query not execute, or believe, because application hangs @ point.
  2. the query not fire failed or success callbacks.
  3. the catch block fired uninformative error. (atleast myself).

the error displayed follows:

error: , {"line":29,"column":21,"sourceurl":"http://10.0.0.20:8100/js/factories/database.js"} 

for curious scheme here following..

table

tx.executesql("create table if not exists messages (message_id integer primary key, content varchar not null, message_to integer not null, message_from integer not null, message_sent integer, message_inserted integer, message_type integer default (0));"); 

insert query

"insert messages (message_id, content, message_to, message_from, message_sent, message_inserted) values (?, ?, ?, ?, ?, ?);" 

insert parameters

[message.id, message.content, message.to, message.from, message.time, math.floor(new date().gettime() / 1000)] 

i've verified of parameters correct, , use correct format table. none of them undefined or null.

the fact issue throwing in try/catch block bothering me, , error very, confusing.


Comments

Popular posts from this blog

how to insert data php javascript mysql with multiple array session 2 -

multithreading - Exception in Application constructor -

windows - CertCreateCertificateContext returns CRYPT_E_ASN1_BADTAG / 8009310b -