Error handling for plugin installation/uninstallaion

This commit is contained in:
Rene Pfeuffer
2019-10-01 09:33:48 +02:00
parent 9261513555
commit aded308138
8 changed files with 40 additions and 7 deletions

View File

@@ -97,7 +97,16 @@ class MultiPluginActionModal extends React.Component<Props, State> {
loading: true
});
apiClient.post(pendingPlugins._links.cancel.href).then(() => this.reload());
apiClient
.post(pendingPlugins._links.cancel.href)
.then(() => this.reload())
.catch(error => {
this.setState({
success: false,
loading: false,
error: error
});
});
};
updateAll = () => {
@@ -239,6 +248,7 @@ class MultiPluginActionModal extends React.Component<Props, State> {
renderBody = () => {
const { actionType } = this.props;
const { error } = this.state;
return (
<>
<div className="media">
@@ -247,6 +257,11 @@ class MultiPluginActionModal extends React.Component<Props, State> {
{this.renderModalContent()}
</div>
</div>
{!!error && (
<div className="media">
<ErrorNotification error={error} />
</div>
)}
{actionType === MultiPluginActionType.EXECUTE_PENDING && (
<div className="media">{this.renderNotifications()}</div>
)}