שמירת טיוטה נושא חדש

The title is not lengthy enough to pass this validation

https://github.com/discourse/discourse/blob/master/app/assets/javascripts/discourse/app/models/composer.js#L1184

But I wonder, why is the code resolving instead of rejecting and then catching errors?

I think errors can be caught here

https://github.com/discourse/discourse/blob/master/app/assets/javascripts/discourse/app/controllers/composer.js#L1244

something along these lines

this._saveDraftPromise = model.saveDraft().then(() => {
    this._lastDraftSaved = Date.now();
    ...
}, error => {
    // error handling here
}).finally(() => {
    this._saveDraftPromise = null;
});

@eviltrout any thoughts?


7 לייקים