Changed then and catch in JavaScript promise

I’m getting the values of a table in my code with this code.

this.dbObject.executeSql("SELECT * FROM atten").then(res => {

      console.log("this is responce = ", res.rows)

    }).catch(err => {

      console.log("this is error = ", err)

    })

the then function not execute.

the catch function executes with right values of the table, don’t get any error “this is error = values”

when I remove the catch method it gets an error

I find my problem. I forgot second argument of the executeSql function

it should be like this.

this.dbObject.executeSql("SELECT * FROM atten", **[]**).then(res => {

      console.log("this is responce = ", res.rows)

    }).catch(err => {

      console.log("this is error = ", err)

    })