Improve fault tolerance of addon delegation requests #572
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Currently there is no error handling for
server_addon/delegate
requests - which I think makes sense on the whole (in line with commentDo not wrap this in error handlers. Server add-ons need to have the flexibility to choose if they want to include a response or not as part of error handling, so a blanket approach is not appropriate.
).However, I think there is just
one
case where I think a bit of error handling might be quite helpful - namely if the requested extension is not available. Currently,@server_addons[name]&.execute(request, params)
swallows any typos or mis-registered servers - but IMO it should be an error with a clear message reported.With the current
delegate_request
implementation in runner_client,make_request
sends theserver_addon/delegate
message to the server, and then gets stuck waiting for a response (which isn't going to come, because@server_addons[name]&.execute(request, params)
is nil) - if I'm understanding things correctly.I'd be curious for any other opinions on this, and if it's of interest I can add some test cases (and/or any more polish)