Skip to content

Commit 7bc4ea5

Browse files
committed
fix(@schematics/update): ignore npm 404 error
Fixes 10614 style(@schematics/update): lint error fix(@schematics/update): remove full stack trace
1 parent a0b9913 commit 7bc4ea5

File tree

1 file changed

+10
-3
lines changed
  • packages/schematics/update/update

1 file changed

+10
-3
lines changed

packages/schematics/update/update/npm.ts

+10-3
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,8 @@ import { logging } from '@angular-devkit/core';
99
import { existsSync, readFileSync } from 'fs';
1010
import { homedir } from 'os';
1111
import * as path from 'path';
12-
import { Observable, from } from 'rxjs';
13-
import { shareReplay } from 'rxjs/operators';
12+
import { empty, Observable, from } from 'rxjs';
13+
import { catchError, shareReplay } from 'rxjs/operators';
1414
import { NpmRepositoryPackageJson } from './npm-package-json';
1515

1616
const ini = require('ini');
@@ -133,7 +133,14 @@ export function getNpmPackageJson(
133133
},
134134
);
135135

136-
const response = from<NpmRepositoryPackageJson>(resultPromise).pipe(shareReplay());
136+
const response = from<NpmRepositoryPackageJson>(resultPromise).pipe(
137+
shareReplay(),
138+
catchError(err => {
139+
logger.warn(err.message || err);
140+
141+
return empty();
142+
}),
143+
);
137144
npmPackageJsonCache.set(packageName, response);
138145

139146
return response;

0 commit comments

Comments
 (0)