add missing error handling

This commit is contained in:
Eduard Heimbuch
2020-08-06 16:55:16 +02:00
parent 1f64d04816
commit 9f8cde331b

View File

@@ -25,9 +25,8 @@ import React from "react";
import { connect } from "react-redux"; import { connect } from "react-redux";
import { RouteComponentProps, withRouter } from "react-router-dom"; import { RouteComponentProps, withRouter } from "react-router-dom";
import { WithTranslation, withTranslation } from "react-i18next"; import { WithTranslation, withTranslation } from "react-i18next";
import { History } from "history";
import { PagedCollection, RepositoryRole } from "@scm-manager/ui-types"; import { PagedCollection, RepositoryRole } from "@scm-manager/ui-types";
import { CreateButton, LinkPaginator, Loading, Notification, Subtitle, Title, urls } from "@scm-manager/ui-components"; import { CreateButton, LinkPaginator, Loading, Notification, Subtitle, Title, urls, ErrorNotification } from "@scm-manager/ui-components";
import { import {
fetchRolesByPage, fetchRolesByPage,
getFetchRolesFailure, getFetchRolesFailure,
@@ -71,7 +70,11 @@ class RepositoryRoles extends React.Component<Props> {
}; };
render() { render() {
const { t, loading } = this.props; const { t, loading, error } = this.props;
if (error) {
return <ErrorNotification />;
}
if (loading) { if (loading) {
return <Loading />; return <Loading />;