Skip to content

Map commands: an editor's failed request carries its own text, not "Internal error." - #1558

Merged
Frotty merged 1 commit into
masterfrom
lsp-map-command-error-message
Oct 24, 2026
Merged

Frotty merged 1 commit into
masterfrom
lsp-map-command-error-message

Conversation

@Frotty

@Frotty Frotty commented Oct 24, 2026

Copy link
Copy Markdown
Member

Problem

A map command which the editor sends with a work-done token (the VS Code extension always sends one) let the editor present a failure, but completed the request with the raw RequestFailedException. lsp4j answers any exception that is not a ResponseErrorException with JSON-RPC -32603 and the message "Internal error.", putting the real text only in the stack trace in error.data. The extension shows the first line of the error's message, so a refused hot reload ("The edit cannot be hot reloaded, rebuild and restart the map: ...") or a failed build showed only "Internal error.".

Change

MapRequest.handleException completes such a request with a ResponseErrorException (RequestFailed, the failure's message). Unexpected exceptions, cancellation and informational results are unchanged.

docs/LUA_HOT_RELOAD.md records the in-game run of the hot reload suite with the editor side driven through the language server (68 of 68 checks, 4.0 to 14.2 s per wurst.hotreload, payloads byte-identical to the command line's) and says how a refusal now reaches the editor.

Validation

  • BuildDiagnosticsTests asserts the error lsp4j would send for a failed build, a warning-level failure and a multi-line hot reload refusal (via RemoteEndpoint.DEFAULT_EXCEPTION_HANDLER); it failed before the change with expected [Build failed] but found [Internal error.].
  • BuildDiagnosticsTests and MapCancellationTest pass locally (Windows).

Not verified: the message as displayed in VS Code (the extension code path was read, not run).

…nternal error."

A map command sent with a work-done token completed with the raw RequestFailedException, which lsp4j answers
as JSON-RPC -32603 "Internal error.", so a refused hot reload or a failed build showed only that in VS Code.
It now completes with a RequestFailed response error carrying the failure's message. The hot reload docs
record the in-game run with the editor side driven through the language server.
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 24, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-10-24T17:11:16.721653Z a281b5c PR opened
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@Frotty
Frotty merged commit 9854dee into master Oct 24, 2026
2 checks passed
@Frotty
Frotty deleted the lsp-map-command-error-message branch November 25, 2026 08:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant