mirror of
https://github.com/discourse/discourse.git
synced 2025-05-25 00:32:52 +08:00
FIX: Broken error reporting in modals (and other places) (#23680)
1. actually call `popupAjaxError`, thanks :P 2. don't close a modal on error 3. use `extractError()` instead of manually joining error messages 4. …or passing just the error object to `this.flash`
This commit is contained in:
@ -4,6 +4,7 @@ import { tracked } from "@glimmer/tracking";
|
||||
import I18n from "I18n";
|
||||
import { ajax } from "discourse/lib/ajax";
|
||||
import { isEmpty } from "@ember/utils";
|
||||
import { extractError } from "discourse/lib/ajax-error";
|
||||
|
||||
const THEME_FIELD_VARIABLE_TYPE_IDS = [2, 3, 4];
|
||||
const SCSS_VARIABLE_NAMES = [
|
||||
@ -108,7 +109,7 @@ export default class ThemeUploadAdd extends Component {
|
||||
this.args.model.addUpload(upload);
|
||||
this.args.closeModal();
|
||||
} catch (e) {
|
||||
this.flash = e.jqXHR.responseJSON.errors.join(". ");
|
||||
this.flash = extractError(e);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user