post error to sentry added to longin

This commit is contained in:
Eudes Inácio
2023-06-30 15:46:41 +01:00
parent 89e11c6fe4
commit 07ae5d1d42
4 changed files with 15 additions and 11 deletions
+6 -2
View File
@@ -1,4 +1,4 @@
import { Injectable } from '@angular/core';
import { Injectable, ErrorHandler } from '@angular/core';
import { StorageService } from './storage.service';
import { HttpClient, HttpHeaders, HttpEventType } from '@angular/common/http';
import { LoginUserRespose, UserForm, UserSession } from '../models/user.model';
@@ -19,6 +19,7 @@ import { InitialsService } from './functions/initials.service';
import { PermissionService } from './permission.service';
import { ChatSystemService } from 'src/app/services/chat/chat-system.service';
import { HttpErrorHandle } from 'src/app/services/http-error-handle.service';
import { captureException } from '@sentry/angular';
@Injectable({
providedIn: 'root'
})
@@ -46,7 +47,8 @@ export class AuthService {
private initialsService: InitialsService,
public p: PermissionService,
public ChatSystemService: ChatSystemService,
private httpErroHandle: HttpErrorHandle) {
private httpErroHandle: HttpErrorHandle,
private errorHandler: ErrorHandler) {
if (SessionStore.exist) {
if(this.p.userPermission(this.p.permissionList.Chat.access) == true ) {
@@ -93,7 +95,9 @@ export class AuthService {
this.SetSession(response, user)
}
} catch (error) {
this.errorHandler.handleError(error);
this.httpErroHandle.httpStatusHandle(error)
captureException(error);
} finally {
return response
}