improve error messages
This commit is contained in:
@@ -1,3 +1,4 @@
|
||||
import { HttpErrorResponse } from '@angular/common/http';
|
||||
import { Component, OnInit } from '@angular/core';
|
||||
import { MatDialog } from '@angular/material/dialog';
|
||||
import { Dashboard, DashboardCreationData, DashboardList, DashboardService } from '../dashboard.service';
|
||||
@@ -31,8 +32,12 @@ export class DashboardPageComponent implements OnInit {
|
||||
this.dataSource = dashboardList.dashboards;
|
||||
this.loading = false;
|
||||
},
|
||||
'error': () => {
|
||||
this.error = "Failed to load dashboards.";
|
||||
'error': (error: HttpErrorResponse) => {
|
||||
if (error.status == 504){
|
||||
this.error = "Server Unreachable";
|
||||
}else{
|
||||
this.error = "Failed to load dashboards";
|
||||
}
|
||||
this.loading = false;
|
||||
}
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user