MOBILE-2354: Fix missing Promise.reject when using createFakeWSError
parent
eb36ee048c
commit
349df95d7e
|
@ -1033,7 +1033,7 @@ export class AddonMessagesProvider {
|
|||
return this.sendMessagesOnline(messages, siteId).then((response) => {
|
||||
if (response && response[0] && response[0].msgid === -1) {
|
||||
// There was an error, and it should be translated already.
|
||||
return this.utils.createFakeWSError(response[0].errormessage);
|
||||
return Promise.reject(this.utils.createFakeWSError(response[0].errormessage));
|
||||
}
|
||||
|
||||
return this.invalidateDiscussionCache(toUserId, siteId).catch(() => {
|
||||
|
|
|
@ -1189,7 +1189,7 @@ export class AddonModFeedbackProvider {
|
|||
};
|
||||
|
||||
return site.write('mod_feedback_process_page', params).catch((error) => {
|
||||
return this.utils.createFakeWSError(error);
|
||||
return Promise.reject(this.utils.createFakeWSError(error));
|
||||
}).then((response) => {
|
||||
// Invalidate and update current values because they will change.
|
||||
return this.invalidateCurrentValuesData(feedbackId, site.getId()).then(() => {
|
||||
|
|
|
@ -179,7 +179,7 @@ export class AddonModForumProvider {
|
|||
return site.write('mod_forum_add_discussion', params).then((response) => {
|
||||
// Other errors ocurring.
|
||||
if (!response || !response.discussionid) {
|
||||
return this.utils.createFakeWSError('');
|
||||
return Promise.reject(this.utils.createFakeWSError(''));
|
||||
} else {
|
||||
return response.discussionid;
|
||||
}
|
||||
|
@ -694,7 +694,7 @@ export class AddonModForumProvider {
|
|||
|
||||
return site.write('mod_forum_add_discussion_post', params).then((response) => {
|
||||
if (!response || !response.postid) {
|
||||
return this.utils.createFakeWSError('');
|
||||
return Promise.reject(this.utils.createFakeWSError(''));
|
||||
} else {
|
||||
return response.postid;
|
||||
}
|
||||
|
|
|
@ -812,7 +812,7 @@ export class AddonModGlossaryProvider {
|
|||
return response.entryid;
|
||||
}
|
||||
|
||||
return this.utils.createFakeWSError('');
|
||||
return Promise.reject(this.utils.createFakeWSError(''));
|
||||
});
|
||||
});
|
||||
}
|
||||
|
|
|
@ -268,7 +268,7 @@ export class AddonModSurveyProvider {
|
|||
|
||||
return site.write('mod_survey_submit_answers', params).then((response) => {
|
||||
if (!response.status) {
|
||||
return this.utils.createFakeWSError('');
|
||||
return Promise.reject(this.utils.createFakeWSError(''));
|
||||
}
|
||||
});
|
||||
});
|
||||
|
|
Loading…
Reference in New Issue