diff --git a/explore/src/app/home/home.component.ts b/explore/src/app/home/home.component.ts index a7b605ef..9de03ff0 100644 --- a/explore/src/app/home/home.component.ts +++ b/explore/src/app/home/home.component.ts @@ -104,8 +104,12 @@ public subPub;public subData;public subProjects;public subOrg; public subDataPr; // if(this.showDataProviders) { // this.fetchDataproviders.getResultsForHome(this.numResults, this.properties); // } - }); - } + }, + error => { + this.handleError("Error getting community information", error); + } + ); + } }); } @@ -144,7 +148,8 @@ public subPub;public subData;public subProjects;public subOrg; public subDataPr; } }, err => { - console.log(err); + //console.log(err); + this.handleError("Error getting number of publications", err); } ); } @@ -156,7 +161,8 @@ public subPub;public subData;public subProjects;public subOrg; public subDataPr; } }, err => { - console.log(err); + //console.log(err); + this.handleError("Error getting number of research data", err); } ); } @@ -174,7 +180,8 @@ public subPub;public subData;public subProjects;public subOrg; public subDataPr; }, err => { - console.log(err); + //console.log(err); + this.handleError("Error getting 'funder' field results of projects", err); }); } if(this.showDataProviders){ @@ -186,10 +193,14 @@ public subPub;public subData;public subProjects;public subOrg; public subDataPr; }, err => { - console.log(err); - + //console.log(err); + this.handleError("Error getting number of content providers", err); } ); } } + + private handleError(message: string, error) { + console.error("Home Page: "+message, error); + } }