Browse Source

feat(ui): Stop reporting permission as error (#49255)

Scott Cooper 1 year ago
parent
commit
43f863afe6
1 changed files with 6 additions and 18 deletions
  1. 6 18
      static/app/views/permissionDenied.tsx

+ 6 - 18
static/app/views/permissionDenied.tsx

@@ -6,31 +6,19 @@ import ExternalLink from 'sentry/components/links/externalLink';
 import LoadingError from 'sentry/components/loadingError';
 import SentryDocumentTitle from 'sentry/components/sentryDocumentTitle';
 import {t, tct} from 'sentry/locale';
-import {Organization, Project} from 'sentry/types';
 import getRouteStringFromRoutes from 'sentry/utils/getRouteStringFromRoutes';
 import {useRoutes} from 'sentry/utils/useRoutes';
-import withOrganization from 'sentry/utils/withOrganization';
-import withProject from 'sentry/utils/withProject';
 
 const ERROR_NAME = 'Permission Denied';
 
-type Props = {
-  organization: Organization;
-  project?: Project;
-};
-
-function PermissionDenied(props: Props) {
-  const {organization, project} = props;
+function PermissionDenied() {
   const routes = useRoutes();
   useEffect(() => {
     const route = getRouteStringFromRoutes(routes);
-    Sentry.withScope(scope => {
-      scope.setFingerprint([ERROR_NAME, route]);
-      scope.setExtra('route', route);
-      scope.setExtra('orgFeatures', (organization && organization.features) || []);
-      scope.setExtra('orgAccess', (organization && organization.access) || []);
-      scope.setExtra('projectFeatures', (project && project.features) || []);
-      Sentry.captureException(new Error(`${ERROR_NAME}${route ? ` : ${route}` : ''}`));
+    Sentry.addBreadcrumb({
+      category: 'auth',
+      message: `${ERROR_NAME}${route ? ` : ${route}` : ''}`,
+      level: 'error',
     });
     // eslint-disable-next-line react-hooks/exhaustive-deps
   }, []);
@@ -54,4 +42,4 @@ function PermissionDenied(props: Props) {
   );
 }
 
-export default withOrganization(withProject(PermissionDenied));
+export default PermissionDenied;