How to show useful error messages from a database error callback in Phonegap?

后端 未结 2 1922
臣服心动
臣服心动 2021-02-15 11:25

Using Phonegap you can set a function to be called back if the whole database transaction or the individual SQL statement errors. I\'d like to know how to get more informatio

2条回答
  •  遥遥无期
    2021-02-15 11:58

    http://docs.phonegap.com/en/2.2.0/cordova_storage_storage.md.html#SQLError

    The SQLError object is thrown when an error occurs when manipulating a database.

    This object has two properties:

    • code (one of your described constants)
    • message: A description of the error.

    So in your code error.message will give you a nice description of what went wrong in which transaction.

    I think that's exactly what you want, isn't it?

    Best regards, F481

提交回复
热议问题