Conversation
ce787ee to
b281ef3
Compare
There was a problem hiding this comment.
Pull request overview
Adjusts uninstall behavior to handle environments where the pantry lookup is unavailable, falling back to alternate package resolution.
Changes:
- Wrap
hooks.usePantry().find(arg)in atry/catchduring uninstall. - Add a log message when pantry lookup fails, then fall back to
plumbing.which(arg).
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| found = (await hooks.usePantry().find(arg))?.[0]; | ||
| } catch { | ||
| console.error( | ||
| "%ci pantry not found, trying to find package another way", |
There was a problem hiding this comment.
Log format string looks incorrect: "%ci pantry not found..." will print an extra i (and may not apply styling as intended). If the goal is to color the whole message, it should start with %c immediately followed by the message text.
| "%ci pantry not found, trying to find package another way", | |
| "%c pantry not found, trying to find package another way", |
| } catch { | ||
| console.error( | ||
| "%ci pantry not found, trying to find package another way", | ||
| "color:blue", | ||
| ); |
There was a problem hiding this comment.
The bare catch {} will swallow all errors from hooks.usePantry().find(arg), including unexpected I/O or parsing failures, and then proceed to plumbing.which, which can hide real problems and make debugging difficult. Consider catching the error as a variable and only falling back when the error indicates the pantry is missing/unavailable; otherwise rethrow (or at least include the error details in the log).
| } catch { | |
| console.error( | |
| "%ci pantry not found, trying to find package another way", | |
| "color:blue", | |
| ); | |
| } catch (err) { | |
| console.error( | |
| "%cerror querying pantry, trying to find package another way", | |
| "color:blue", | |
| ); | |
| console.error(err); |
No description provided.