Skip to content
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Commit d2486a6

Browse files
committedDec 19, 2018
fix(@schematics/update): ignore npm 404 error
Fixes 10614 style(@schematics/update): lint error fix(@schematics/update): remove full stack trace style: organize import order
1 parent a0b9913 commit d2486a6

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

Lines changed: 10 additions & 3 deletions
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 { Observable, empty, 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)
Please sign in to comment.