Skip to content

Commit bff2790

Browse files
tiaguinhohansl
authored andcommitted
fix(@schematics/update): ignore npm 404 error
Fixes 10614 style(@schematics/update): lint error fix(@schematics/update): remove full stack trace style(@schematics/update): organize import order refactor(@schematics/update): use empty constant
1 parent 25a2774 commit bff2790

File tree

1 file changed

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

1 file changed

+11
-3
lines changed

packages/schematics/update/update/npm.ts

Lines changed: 11 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 { 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,15 @@ export function getNpmPackageJson(
133133
},
134134
);
135135

136-
const response = from<NpmRepositoryPackageJson>(resultPromise).pipe(shareReplay());
136+
// TODO: find some way to test this
137+
const response = from<NpmRepositoryPackageJson>(resultPromise).pipe(
138+
shareReplay(),
139+
catchError(err => {
140+
logger.warn(err.message || err);
141+
142+
return EMPTY;
143+
}),
144+
);
137145
npmPackageJsonCache.set(packageName, response);
138146

139147
return response;

0 commit comments

Comments
 (0)