From 4aa852ce2e08788d5273761cccc3ebf62c3123a6 Mon Sep 17 00:00:00 2001 From: Dor-Karni Date: Tue, 14 Dec 2021 18:30:30 +0200 Subject: [PATCH] Fix error message --- cloudapp/src/app/catalog/main/main.component.ts | 6 +++--- cloudapp/src/app/holdings/form/form.component.ts | 2 +- cloudapp/src/app/holdings/main/main.component.ts | 6 +++--- .../src/app/holdings/viewHoldings/viewHoldings.component.ts | 4 ++-- cloudapp/src/app/service/catalog.service.ts | 6 +++--- 5 files changed, 12 insertions(+), 12 deletions(-) diff --git a/cloudapp/src/app/catalog/main/main.component.ts b/cloudapp/src/app/catalog/main/main.component.ts index ac259ff..b055db2 100644 --- a/cloudapp/src/app/catalog/main/main.component.ts +++ b/cloudapp/src/app/catalog/main/main.component.ts @@ -192,7 +192,7 @@ export class CatalogMainComponent implements AfterViewInit { } }, error: e => { this.loading = false; - console.log(e.message); + console.log(e); this.alert.error(e.message, {keepAfterRouteChange:true}); }, complete: () => this.loading = false @@ -318,7 +318,7 @@ export class CatalogMainComponent implements AfterViewInit { }, error: e => { this.loading = false; - console.log(e.message); + console.log(e); this.alert.error(e.message, {keepAfterRouteChange:true}); }, complete: () => this.loading = false @@ -348,7 +348,7 @@ export class CatalogMainComponent implements AfterViewInit { error: e => { this.loading = false; console.log(e); - this.alert.error(e, {keepAfterRouteChange:true}); + this.alert.error(e.message, {keepAfterRouteChange:true}); }, complete: () => this.loading = false }); diff --git a/cloudapp/src/app/holdings/form/form.component.ts b/cloudapp/src/app/holdings/form/form.component.ts index 64e49f4..edce8b4 100644 --- a/cloudapp/src/app/holdings/form/form.component.ts +++ b/cloudapp/src/app/holdings/form/form.component.ts @@ -179,7 +179,7 @@ export class FormComponent implements OnInit { }, error: e => { this.loading = false; - console.log(e.message); + console.log(e); this.alert.error(e.message, {keepAfterRouteChange:true}); }, complete: () => this.loading = false diff --git a/cloudapp/src/app/holdings/main/main.component.ts b/cloudapp/src/app/holdings/main/main.component.ts index 58b73bb..ad8ff31 100644 --- a/cloudapp/src/app/holdings/main/main.component.ts +++ b/cloudapp/src/app/holdings/main/main.component.ts @@ -82,7 +82,7 @@ export class MainComponent implements OnInit, OnDestroy { }, error: e => { this.loading = false; - console.log(e.message); + console.log(e); this.alert.error(e.message, {keepAfterRouteChange:true}); }, complete: () => { @@ -96,7 +96,7 @@ export class MainComponent implements OnInit, OnDestroy { error: e => { this.loading = false; console.log(e); - this.alert.error(e, {keepAfterRouteChange:true}); + this.alert.error(e.message, {keepAfterRouteChange:true}); }, complete: () => { this.loading = false; @@ -140,7 +140,7 @@ export class MainComponent implements OnInit, OnDestroy { }, error: e => { this.loading = false; - console.log(e.message); + console.log(e); this.alert.error(e.message, { keepAfterRouteChange: true }); }, complete: () => this.loading = false diff --git a/cloudapp/src/app/holdings/viewHoldings/viewHoldings.component.ts b/cloudapp/src/app/holdings/viewHoldings/viewHoldings.component.ts index c88f2dd..5e975f1 100644 --- a/cloudapp/src/app/holdings/viewHoldings/viewHoldings.component.ts +++ b/cloudapp/src/app/holdings/viewHoldings/viewHoldings.component.ts @@ -97,7 +97,7 @@ export class HoldingsComponent implements OnInit { }, error: e => { this.loading = false; - console.log(e.message); + console.log(e); this.alert.error(e.message, {keepAfterRouteChange:true}); }, complete: () => this.loading = false @@ -177,7 +177,7 @@ export class HoldingsComponent implements OnInit { }, error: e => { this.loading = false; - console.log(e.message); + console.log(e); this.alert.error(e.message, {keepAfterRouteChange:true}); }, complete: () => this.loading = false diff --git a/cloudapp/src/app/service/catalog.service.ts b/cloudapp/src/app/service/catalog.service.ts index 3d0b4bf..4ca7ec6 100644 --- a/cloudapp/src/app/service/catalog.service.ts +++ b/cloudapp/src/app/service/catalog.service.ts @@ -132,17 +132,17 @@ export class CatalogService extends BaseService { case (SearchType.Monographs): case (SearchType.Serials): if(this.isEmpty(integrationProfile.repositoryImportProfile)){ - throw "The Repository Import Profile is not configured correctly"; + throw new Error("The Repository Import Profile is not configured correctly"); } return { typeTag: "bib", urlType: "", ID: integrationProfile.repositoryImportProfile }; case (SearchType.Names): if(this.isEmpty(integrationProfile.authorityImportProfileNames)){ - throw "The Authority Import Profile Names is not configured correctly"; + throw new Error("The Authority Import Profile Names is not configured correctly"); } return { typeTag: "authority", urlType: "/authorities", ID: integrationProfile.authorityImportProfileNames }; case (SearchType.UniformTitles): if(this.isEmpty(integrationProfile.authorityImportProfileUniformTitles)){ - throw "The Authority Import Profile Uniform Titles is not configured correctly"; + throw new Error("The Authority Import Profile Uniform Titles is not configured correctly"); } return { typeTag: "authority", urlType: "/authorities", ID: integrationProfile.authorityImportProfileUniformTitles}; }