-
Notifications
You must be signed in to change notification settings - Fork 12
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 usePantry().missing() throwing PantryNotFoundError #80
Conversation
Pull Request Test Coverage Report for Build 12819552467Details
💛 - Coveralls |
@mxcl I'm pretty sure these reported coverage issues are a mistake of the checker, and not introduced by this PR. |
dc97aaa
to
3516b41
Compare
yeah, it's comparing against |
I do not understand the patch or the bug. |
Oh. Let me explain. @mxcl However, there was a code path when calling this function that could still throw an error, unexpectedly. This is the code path: libpkgx/src/hooks/usePantry.ts Line 50 in 6075ded
This code path is exercised when running I refactored the The |
The other functions, the ones that will in fact access the pantry, will throw an error if the pantry is missing. Then, pkgxdev/pkgx#1067 will catch these situations and perform the pantry initialization as needed. |
Right. I see thanks. |
Thank you! |
The
missing()
function's purpose is to avoid throwing an error when the pantry is missing. This fixes this logic and even adds a test to verify such behavior (you can verify that new test fails with the previous code).This is first part of the fix for pkgxdev/pkgm#5.