Skip to content

Commit 4da3ebc

Browse files
authored
fix: Connection failure in Parse.Object.saveEventually and Parse.Object.destroyEventually not handled on custom Parse.Error.CONNECTION_FAILURE message (#2032)
1 parent e36ddaf commit 4da3ebc

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/ParseObject.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1219,7 +1219,7 @@ class ParseObject {
12191219
try {
12201220
await this.save(null, options);
12211221
} catch (e) {
1222-
if (e.message === 'XMLHttpRequest failed: "Unable to connect to the Parse API"') {
1222+
if (e.code === ParseError.CONNECTION_FAILED) {
12231223
await EventuallyQueue.save(this, options);
12241224
EventuallyQueue.poll();
12251225
}
@@ -1363,7 +1363,7 @@ class ParseObject {
13631363
try {
13641364
await this.destroy(options);
13651365
} catch (e) {
1366-
if (e.message === 'XMLHttpRequest failed: "Unable to connect to the Parse API"') {
1366+
if (e.code === ParseError.CONNECTION_FAILED) {
13671367
await EventuallyQueue.destroy(this, options);
13681368
EventuallyQueue.poll();
13691369
}

0 commit comments

Comments
 (0)