Skip to content

Commit

Permalink
fix: Connection failure in Parse.Object.saveEventually and `Parse.O…
Browse files Browse the repository at this point in the history
…bject.destroyEventually` not handled on custom `Parse.Error.CONNECTION_FAILURE` message (#2032)
  • Loading branch information
dplewis authored Oct 4, 2023
1 parent e36ddaf commit 4da3ebc
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/ParseObject.js
Original file line number Diff line number Diff line change
Expand Up @@ -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();
}
Expand Down Expand Up @@ -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();
}
Expand Down

0 comments on commit 4da3ebc

Please sign in to comment.