Skip to content

Commit

Permalink
fix(frontend): fix build & double mention in sentry
Browse files Browse the repository at this point in the history
  • Loading branch information
pYassine committed Nov 6, 2024
1 parent 51d11c5 commit e79dcb3
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 12 deletions.
17 changes: 7 additions & 10 deletions packages/frontend/src/app/interceptors/server-error.interceptor.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,8 @@ import { Injectable, Injector } from "@angular/core";
import { Observable, throwError, timer } from "rxjs";
import { catchError, retry } from "rxjs/operators";
import { AuthService } from "../modules/shared/services/auth.service";
import { captureException, getCurrentScope } from "@sentry/angular";
import { getCurrentScope } from "@sentry/angular";
import { CustomToastService } from "../modules/shared/services";
import { Router } from "@angular/router";

const MAX_RETRIES = 2;
const RETRY_DELAY = 1000;
Expand All @@ -31,7 +30,6 @@ export class ServerErrorInterceptor implements HttpInterceptor {
): Observable<HttpEvent<any>> {
const authService = this.injector.get(AuthService);
const toastr = this.injector.get(CustomToastService);
const router = this.injector.get(Router);

if (authService?.currentUserValue) {
const user = authService.currentUserValue;
Expand Down Expand Up @@ -74,17 +72,17 @@ export class ServerErrorInterceptor implements HttpInterceptor {
}
if (error.status === 401) {
authService.logoutAndRedirect(undefined, true);
} else if (error.status === 404) {
toastr.error("La page que vous recherchez n'existe pas");
router.navigate(["404"]);
} else {
toastr.error(
"Une erreur serveur est survenue. Nos équipes ont été notifiées."
"Votre session a expiré, merci de vous connecter à nouveau"
);
}
} else {
toastr.error(
"Une erreur serveur est survenue. Nos équipes ont été notifiées."
);
}
this.logError(request, error);
return;
return throwError(() => error);
})
);
}
Expand All @@ -102,6 +100,5 @@ export class ServerErrorInterceptor implements HttpInterceptor {
error: error.error,
request,
});
captureException(error, { data: request });
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -488,7 +488,7 @@ <h4>Dois-je maintenir mon registre de signature avec DomiFa ?</h4>
conserver ou non le registre de signature papier existant.
</p>
</div>
<div id="faq-videos">
<!-- <div id="faq-videos">
<h2 class="mt-2">Tutoriels vidéos</h2>
<p>
Voici quelques vidéos qui vous aideront à utiliser DomiFa au mieux.
Expand Down Expand Up @@ -599,7 +599,7 @@ <h3 class="mt-2">Activer et utiliser les SMS</h3>
</video>
</div>
</div>
</div>
</div> -->
</div>
</div>
</div>

0 comments on commit e79dcb3

Please sign in to comment.