Skip to content

Commit

Permalink
Fixing error handling for schema admin settings (mattermost#4414)
Browse files Browse the repository at this point in the history
  • Loading branch information
jespino committed Dec 3, 2019
1 parent 2621272 commit 8b1d273
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions components/admin_console/schema_admin_settings.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -842,14 +842,14 @@ export default class SchemaAdminSettings extends React.Component {
let config = JSON.parse(JSON.stringify(this.props.config));
config = this.getConfigFromState(config);

try {
await this.props.updateConfig(config);
this.setState(getStateFromConfig(config));
} catch (err) {
const {error} = await this.props.updateConfig(config);
if (error) {
this.setState({
serverError: err.message,
serverErrorId: err.id,
serverError: error.message,
serverErrorId: error.id,
});
} else {
this.setState(getStateFromConfig(config));
}

if (callback) {
Expand Down

0 comments on commit 8b1d273

Please sign in to comment.