var query = ... query.begin() try { query.insertRow({ table: '', data: {} }) if (query.lastError().isValid()) throw query.lastError().text() } catch(e) { }