Skip to content
Snippets Groups Projects
Commit 4423a378 authored by Jan-Christoph Borchardt's avatar Jan-Christoph Borchardt Committed by GitHub
Browse files

Merge pull request #494 from nextcloud/fix/message-loading-error-propagation

Fix error propagation in case messages cannot be loaded
parents ae341b9b fc007d9c
No related branches found
No related tags found
No related merge requests found
......@@ -57,17 +57,20 @@ define(function(require) {
folderId: folder.get('id')
});
return Promise.resolve($.ajax(url, {
data: {
filter: options.filter
},
error: function(error, status) {
if (status !== 'abort') {
console.error('error loading messages', error);
throw new Error(error);
return new Promise(function(resolve, reject) {
$.ajax(url, {
data: {
filter: options.filter
},
success: resolve,
error: function(error, status) {
if (status !== 'abort') {
console.error('error loading messages', error, status);
reject(error);
}
}
}
})).then(function(messages) {
});
}).then(function(messages) {
var isSearching = options.filter !== '';
var collection = folder.messages;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment