Skip to content

Commit

Permalink
fix(@schematics/update): ignore npm 404 error
Browse files Browse the repository at this point in the history
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
  • Loading branch information
tiaguinho authored and hansl committed Dec 20, 2018
1 parent 25a2774 commit bff2790
Showing 1 changed file with 11 additions and 3 deletions.
14 changes: 11 additions & 3 deletions packages/schematics/update/update/npm.ts
Expand Up @@ -9,8 +9,8 @@ import { logging } from '@angular-devkit/core';
import { existsSync, readFileSync } from 'fs';
import { homedir } from 'os';
import * as path from 'path';
import { Observable, from } from 'rxjs';
import { shareReplay } from 'rxjs/operators';
import { EMPTY, Observable, from } from 'rxjs';
import { catchError, shareReplay } from 'rxjs/operators';
import { NpmRepositoryPackageJson } from './npm-package-json';

const ini = require('ini');
Expand Down Expand Up @@ -133,7 +133,15 @@ export function getNpmPackageJson(
},
);

const response = from<NpmRepositoryPackageJson>(resultPromise).pipe(shareReplay());
// TODO: find some way to test this
const response = from<NpmRepositoryPackageJson>(resultPromise).pipe(
shareReplay(),
catchError(err => {
logger.warn(err.message || err);

return EMPTY;
}),
);
npmPackageJsonCache.set(packageName, response);

return response;
Expand Down

0 comments on commit bff2790

Please sign in to comment.