Skip to content

Commit 6d20333

Browse files
fix(Storage): display access denied on 403
1 parent 6f14843 commit 6d20333

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

src/containers/Storage/Storage.js

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ import {Search} from '../../components/Search';
99
import {UsageFilter} from './UsageFilter';
1010
import {AutoFetcher} from '../../utils/autofetcher';
1111
import {TableSkeleton} from '../../components/TableSkeleton/TableSkeleton';
12+
import {AccessDenied} from '../../components/Errors/403';
1213

1314
import {
1415
getStorageInfo,
@@ -287,10 +288,17 @@ class Storage extends React.Component {
287288
const {loading, wasLoaded, error} = this.props;
288289
const showLoader = loading && !wasLoaded;
289290

291+
if (error) {
292+
if (error.status === 403) {
293+
return <AccessDenied />;
294+
}
295+
296+
return <div className={b()}>{error.statusText}</div>;
297+
}
298+
290299
return (
291300
<div className={b()}>
292301
{this.renderControls()}
293-
{error && <div>{error.statusText}</div>}
294302
{showLoader ? this.renderLoader() : this.renderDataTable()}
295303
</div>
296304
);

0 commit comments

Comments
 (0)