Skip to content
Snippets Groups Projects
Commit 6741c86e authored by Clayton, Brandon Scott's avatar Clayton, Brandon Scott
Browse files

add try-catch, return copy ov values

parent 75653741
No related branches found
No related tags found
1 merge request!563GMM Epistemic Issue
...@@ -287,10 +287,20 @@ export class AppService ...@@ -287,10 +287,20 @@ export class AppService
this.nshmpService this.nshmpService
.callServices$<GmmSpectraResponse>(urls) .callServices$<GmmSpectraResponse>(urls)
.pipe(catchError((error: Error) => this.nshmpService.throwError$(error))) .pipe(
catchError((error: Error) => {
spinnerRef.close();
return this.nshmpService.throwError$(error);
}),
)
.subscribe(serviceResponses => { .subscribe(serviceResponses => {
this.handleServiceResponses(serviceResponses); try {
spinnerRef.close(); this.handleServiceResponses(serviceResponses);
spinnerRef.close();
} catch (error) {
spinnerRef.close();
this.nshmpService.throwError$(error as Error);
}
}); });
} }
...@@ -521,7 +531,7 @@ export class AppService ...@@ -521,7 +531,7 @@ export class AppService
}) })
.sort((a, b) => a - b); .sort((a, b) => a - b);
return xValues; return [...xValues];
} }
private handleServiceResponses(serviceResponses: GmmSpectraResponse[]): void { private handleServiceResponses(serviceResponses: GmmSpectraResponse[]): void {
......
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