Skip to content
Snippets Groups Projects
Commit b7e333f1 authored by Chris Hines's avatar Chris Hines
Browse files

add notifications when the stat command doesn't work

parent 424ac07e
No related branches found
No related tags found
4 merge requests!106if stat fails, display the error instead of immediately refreshing...,!99Dev,!54Test,!53Dev
Pipeline #10341 passed
......@@ -7,6 +7,8 @@ import { Identity } from './identity';
import { Subscription, interval, pipe, Observable } from 'rxjs';
import { BehaviorSubject, timer } from 'rxjs';
import { repeat } from 'rxjs/operators';
import { NotificationsService } from './notifications.service';
@Injectable({
providedIn: 'root'
......@@ -16,7 +18,7 @@ export class JobsService {
private tsub: Subscription;
private id: Identity;
constructor(private tes: TesService, private authService: AuthorisationService) {
constructor(private tes: TesService, private authService: AuthorisationService, private notifications: NotificationsService ) {
this.jobs$ = new BehaviorSubject([]);
}
......@@ -39,6 +41,11 @@ export class JobsService {
}
public getJobsError(error,identity: Identity) {
if (error.hasOwnProperty("error") && error.error.hasOwnProperty("message")) {
this.notifications.notify(error.error.message);
this.tsub.unsubscribe();
return;
}
this.tsub.unsubscribe()
this.authService.updateAgentContents().subscribe((_) => {return});
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment