Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 6 additions & 2 deletions src/main/webapp/app/layouts/profiles/profile.service.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { Injectable, inject } from '@angular/core';
import { HttpClient } from '@angular/common/http';
import { map, shareReplay } from 'rxjs/operators';
import { Observable } from 'rxjs';
import { catchError, map, shareReplay } from 'rxjs/operators';
import { Observable, of } from 'rxjs';

import { ApplicationConfigService } from 'app/core/config/application-config.service';
import { InfoResponse, ProfileInfo } from './profile-info.model';
Expand Down Expand Up @@ -36,6 +36,10 @@ export class ProfileService {
}
return profileInfo;
}),
// If the management/info endpoint is unavailable (e.g. backend not reachable),
// degrade gracefully to default profile info instead of letting the error
// propagate uncaught to every subscriber (navbar, footer, page-ribbon, ...).
catchError(() => of(new ProfileInfo())),
shareReplay(),
);
return this.profileInfo$;
Expand Down