-
Notifications
You must be signed in to change notification settings - Fork 12k
fix(@schematics/update): ignore npm 404 error #13167
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
d0af0f5
to
749cc24
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, though can you kindly add the fixes footer in the commit message?
Ex
fix(@schematics/update): ignore npm 404 error
Fixes 10614
749cc24
to
f30de52
Compare
@alan-agius4 just did it! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This will have the unfortunately side effect of hiding legitimate errors as well.
Can you change this to catch errors at the getNpmPackageJson
call site rather than within the function itself and log the error so that the user has knowledge of the issue.
Ideally, the getNpmPackageJson
function should not be called if the package specifier does not point to a registry.
@clydin we can use the workspace configuration to search local packages and filter |
13e6cc3
to
ec89e3d
Compare
Changed! cc: @alan-agius4 @clydin |
catchError(err => { | ||
logger.warn(err); | ||
|
||
return EMPTY; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
use empty()
instead of EMPTY
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Disregard, EMPTY
is fine (see https://rxjs.dev/api/index/const/EMPTY)
const response = from<NpmRepositoryPackageJson>(resultPromise).pipe( | ||
shareReplay(), | ||
catchError(err => { | ||
logger.warn(err); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you change this to logger.warn(err.message || err)
? The user doesn't need the full stack trace.
7bc4ea5
to
d2486a6
Compare
Hi @clydin just made the changes you asked. Thanks! |
catchError(err => { | ||
logger.warn(err.message || err); | ||
|
||
return empty(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sorry, please use EMPTY
(see https://rxjs.dev/api/index/const/EMPTY).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
hahaha, no problem.
Additionally, could you add a |
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
d2486a6
to
fe1a7e6
Compare
Thanks @tiaguinho ! This looks good to go in. I'll try to get @alan-agius4 to approve. |
This issue has been automatically locked due to inactivity. Read more about our automatic conversation locking policy. This action has been performed automatically by a bot. |
This PR will fix the issue #10614