Skip to content
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

fix(cli): catch all possible errors thrown from proper-filelock #5347

Merged
merged 3 commits into from Mar 23, 2019

Conversation

pimlie
Copy link

@pimlie pimlie commented Mar 22, 2019

image

Types of changes

  • Bug fix (a non-breaking change which fixes an issue)
  • New feature (a non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)

Description

Ref: #5324

Although I could have expected it maybe, its not really documented that proper-lockfile also throws errors when it cant release a lock. This pr should fix that behaviour by wrapping any code which originates from proper-lockfile in a try/catch and warn when an error was thrown.

The only time a lock should result in a Nuxt Fatal Error is when a lock with the same id already exists.

Checklist:

  • My change requires a change to the documentation.
  • I have updated the documentation accordingly. (PR: #)
  • I have added tests to cover my changes (if not applicable, please state why)
  • All new and existing tests are passing.

packages/utils/src/locking.js Outdated Show resolved Hide resolved
packages/utils/src/locking.js Outdated Show resolved Hide resolved
Copy link
Member

@pi0 pi0 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice attempt @pimlie 👍

@codecov-io
Copy link

codecov-io commented Mar 22, 2019

Codecov Report

Merging #5347 into dev will increase coverage by 0.06%.
The diff coverage is 100%.

Impacted file tree graph

@@            Coverage Diff             @@
##              dev    #5347      +/-   ##
==========================================
+ Coverage   95.66%   95.72%   +0.06%     
==========================================
  Files          74       74              
  Lines        2513     2529      +16     
  Branches      639      641       +2     
==========================================
+ Hits         2404     2421      +17     
+ Misses         92       91       -1     
  Partials       17       17
Impacted Files Coverage Δ
packages/utils/src/locking.js 100% <100%> (ø) ⬆️
packages/vue-renderer/src/renderer.js 92.07% <0%> (+0.49%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 3c50876...c713b3f. Read the comment docs.

@pi0 pi0 changed the title fix: catch all possible errors thrown from proper-filelock fix(cli): catch all possible errors thrown from proper-filelock Mar 23, 2019
@pi0 pi0 merged commit 39bbe46 into nuxt:dev Mar 23, 2019
@pi0 pi0 mentioned this pull request Mar 23, 2019
@pimlie pimlie deleted the fix-prevent-error-on-already-released-lock branch August 25, 2019 16:15
@danielroe danielroe added the 2.x label Jan 18, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants