Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
getMetadata(product: any): void {
if (product === null || !product.contents['download/info.json']) {
this.onMetadata(null);
return;
}
const metadata = product.contents['download/info.json'];
this.httpClient
.get(metadata.url)
.pipe(catchError(this.handleError()))
.subscribe((data: any) => {
try {
this.onMetadata(data);
} catch (e) {
/* Processing error */
this.error = e;
this.metadata$.next(null);
}
});
}getMetadata(product: any): void {
if (product === null || !product.contents['download/info.json']) {
this.onMetadata(null);
return;
}
const metadata = product.contents['download/info.json'];
this.httpClient
.get(metadata.url)
.pipe(catchError(this.handleError()))
.subscribe((data: any) => {
try {
this.onMetadata(data);
} catch (e) {
/* Processing error */
this.error = e;
this.metadata$.next(null);