diff --git a/src/ParseObject.js b/src/ParseObject.js index f324f6c28..32701191b 100644 --- a/src/ParseObject.js +++ b/src/ParseObject.js @@ -1219,7 +1219,7 @@ class ParseObject { try { await this.save(null, options); } catch (e) { - if (e.message === 'XMLHttpRequest failed: "Unable to connect to the Parse API"') { + if (e.code === ParseError.CONNECTION_FAILED) { await EventuallyQueue.save(this, options); EventuallyQueue.poll(); } @@ -1363,7 +1363,7 @@ class ParseObject { try { await this.destroy(options); } catch (e) { - if (e.message === 'XMLHttpRequest failed: "Unable to connect to the Parse API"') { + if (e.code === ParseError.CONNECTION_FAILED) { await EventuallyQueue.destroy(this, options); EventuallyQueue.poll(); }