From f3c39cf84840a5f7504a1538948a2016c5bcf663 Mon Sep 17 00:00:00 2001 From: christophe-g Date: Wed, 3 Oct 2018 12:39:57 +0200 Subject: [PATCH 1/2] made sure that unsucessful write are cached and that an error event is fired --- firebase-database-behavior.html | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/firebase-database-behavior.html b/firebase-database-behavior.html index 60c38af..9816261 100644 --- a/firebase-database-behavior.html +++ b/firebase-database-behavior.html @@ -80,7 +80,10 @@ if (key) { value.$key = null; } - var result = this.db.ref(path).set(leaf ? value.$val : value); + var result = this.db.ref(path).set(leaf ? value.$val : value) + .catch(e => { + this.__onError(e); + }); if (key) { value.$key = key; } From cf7b8fb1f36128841100e61486fc3cebea4e5e4d Mon Sep 17 00:00:00 2001 From: christophe-g Date: Thu, 9 Jan 2020 17:26:18 +0100 Subject: [PATCH 2/2] enrich firebase error with key, path and value --- firebase-database-behavior.html | 3 +++ 1 file changed, 3 insertions(+) diff --git a/firebase-database-behavior.html b/firebase-database-behavior.html index 9816261..984854d 100644 --- a/firebase-database-behavior.html +++ b/firebase-database-behavior.html @@ -82,6 +82,9 @@ } var result = this.db.ref(path).set(leaf ? value.$val : value) .catch(e => { + e.key = key || value.$key; + e.path = path; + e.value = value; this.__onError(e); }); if (key) {