Error Promise IONIC 2


how to return the "text of error in promise;

if(data.rows.length > 0){"UPDATE configDB SET loja = ?, servidor = ?, token = ?, itens = ?, servidores = ?", [config.loja, config.servidor, config.token, config.itens, config.servidores])
(data) => {
this.presentToast("Configuração atualizada com sucesso.");
(error) => {


If you’re asking “how do I return the result of an asynchronous operation out of the function that initiated it?”, the short answer is “you can’t”. The longer answer is that the best you can do is return the Promise itself.


no, i want read it: "error"
(error) => {
this.presentToast(error); error = Object


You can use JSON.stringify() to guide you as to what the object looks like, but a safer way would be to look at the public API of whatever function is generating the result.


Thanks man, now i can!!