Skip to content
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

Delegate error to action dispatcher #1386

Open
haydar-metin opened this issue Aug 8, 2024 · 1 comment
Open

Delegate error to action dispatcher #1386

haydar-metin opened this issue Aug 8, 2024 · 1 comment
Assignees
Labels
bug Something isn't working client server-node

Comments

@haydar-metin
Copy link

haydar-metin commented Aug 8, 2024

Currently, it is not possible to catch an error thrown by a handler at the location where the action was dispatched when the error was thrown on the server.

https://github.com/eclipse-sprotty/sprotty/blob/c9e7c730842720f032dbf6ae2b346fc252bf63a0/packages/sprotty/src/base/actions/action-dispatcher.ts#L46

https://github.com/eclipse-glsp/glsp-client/blob/8eb216caeeb5efa5691e39a449ee18a4aba99298/packages/client/src/base/action-dispatcher.ts#L24

The server does not delegate the error, it catches the error and sends a MessageAction:

https://github.com/eclipse-glsp/glsp-server-node/blob/main/packages/server/src/common/protocol/glsp-server.ts#L167

@haydar-metin haydar-metin added the bug Something isn't working label Aug 8, 2024
@haydar-metin haydar-metin self-assigned this Aug 8, 2024
@planger
Copy link
Member

planger commented Sep 19, 2024

Suggested solution:
Introduce ExecuteOperationRequestAction which wraps the operation and has a response on completion or throws error. This should then be orthogonal to existing code but allow the requested functionality.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working client server-node
Projects
None yet
Development

No branches or pull requests

2 participants