summaryrefslogtreecommitdiffstats
path: root/src/pybind/mgr/dashboard/frontend/src/app/core/error/error.ts
blob: 0270a45871322d49299fd40c5e27efa4e1d32559 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
import { Icons } from '~/app/shared/enum/icons.enum';

export class DashboardError extends Error {
  header: string;
  message: string;
  icon: string;
}

export class DashboardNotFoundError extends DashboardError {
  header = $localize`Page Not Found`;
  message = $localize`Sorry, we couldn’t find what you were looking for.
  The page you requested may have been changed or moved.`;
  icon = Icons.warning;
}

export class DashboardForbiddenError extends DashboardError {
  header = $localize`Access Denied`;
  message = $localize`Sorry, you don’t have permission to view this page or resource.`;
  icon = Icons.lock;
}

export class DashboardUserDeniedError extends DashboardError {
  header = $localize`User Denied`;
  message = $localize`Sorry, the user does not exist in Ceph.
  You'll be logged out from the Identity Provider when you retry logging in.`;
  icon = Icons.warning;
}