-
-
Notifications
You must be signed in to change notification settings - Fork 36
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
Detect constraints errors #403
Conversation
WalkthroughThe recent changes enhance error handling in the Changes
Assessment against linked issues
Poem
Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media? TipsChatThere are 3 ways to chat with CodeRabbit:
Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (invoked as PR comments)
Additionally, you can add CodeRabbit Configuration File (
|
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.
Actionable comments posted: 0
Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Files selected for processing (1)
- autoload/denops/_internal/server/chan.vim (1 hunks)
Additional comments not posted (1)
autoload/denops/_internal/server/chan.vim (1)
173-184
: LGTM! The newcatch
block improves error handling.The added
catch
block effectively handles specific Deno module cache issues and provides clear guidance to users.
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #403 +/- ##
=======================================
Coverage 95.52% 95.52%
=======================================
Files 23 23
Lines 1384 1384
Branches 174 174
=======================================
Hits 1322 1322
Misses 59 59
Partials 3 3 ☔ View full report in Codecov by Sentry. |
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 but I'd like to hear @Milly's opinion if the code is written in a right section.
@@ -170,6 +170,18 @@ function! s:reconnect(options) abort | |||
\)) | |||
try | |||
call s:connect(s:addr, a:options) | |||
catch /Could not find constraint\|Could not find version of/ |
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 probably won't be caught.
I think #401 occurs in denops#server#start()
.
And the error message is outputs on here:
denops.vim/autoload/denops/_internal/server/proc.vim
Lines 87 to 93 in f5bcc4f
function! s:on_stderr(data) abort | |
echohl ErrorMsg | |
for l:line in split(a:data, '\n') | |
echomsg printf('[denops] %s', substitute(l:line, '\t', ' ', 'g')) | |
endfor | |
echohl None | |
endfunction |
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 denops#_internal#echo#warn()
instead debug.
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.
I have changed it to use warn.
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 probably won't be caught.
I don't think so. Because of the error message.
[denops] Server stopped (1). Restarting...
[denops] Failed to connect channel ``: Vim(let):connection failed: tcp address must be host:port
The error messages are only printed the function.
catch
call denops#_internal#echo#debug(printf(
\ 'Failed to reconnect channel `%s` [%d/%d]: %s',
\ s:addr,
\ s:reconnect_count,
\ a:options.reconnect_threshold,
\ v:exception,
\))
call s:schedule_reconnect(a:options)
endtry
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.
Oh, my bad.
denops#_internal#server#chan#connect()
is correct instead.
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.
The error message breaks down as follows:
Outputs at s:on_exit()
in autoload/denops/_internal/server/proc.vim:
[denops] Server stopped (1). Restarting...
Outputs at denops#_internal#server#chan#connect()
:
[denops] Failed to connect channel ``: Vim(let):connection failed: tcp address must be host:port
Note that it says channel ``:
, which means addr
is an empty string, so the local server will not start correctly. This is another bug caused by missing error handling.
If addr
is empty, DenopsSystemProcessListen:addr
event should not be fired, but this is a different scope so a separate PR would be better.
Outputs at s:on_stderr()
in autoload/denops/_internal/server/proc.vim:
[denops] error: Could not find constraint in the list of versions: @std/async@^1.0.1
[denops] Specifier: jsr:@std/async@^1.0.1/deadline
[denops] at file:///Users/giginet/.local/share/nvim/lazy/denops.vim/denops/@denops-private/cli.ts:5:26
Note that this is not a part of the connect() error message.
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.
Hm...
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.
Actionable comments posted: 0
Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Files selected for processing (1)
- autoload/denops/_internal/server/chan.vim (1 hunks)
Files skipped from review as they are similar to previous changes (1)
- autoload/denops/_internal/server/chan.vim
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.
Actionable comments posted: 0
Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Files selected for processing (1)
- autoload/denops/_internal/server/chan.vim (1 hunks)
Files skipped from review as they are similar to previous changes (1)
- autoload/denops/_internal/server/chan.vim
Fix #401
I have added the check for denops.vim.
Summary by CodeRabbit