glsp icon indicating copy to clipboard operation
glsp copied to clipboard

Delegate error to action dispatcher

Open haydar-metin opened this issue 1 year ago • 1 comments

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 avatar Aug 08 '24 09:08 haydar-metin

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.

planger avatar Sep 19 '24 08:09 planger

As part of this we may also consider https://github.com/eclipse-glsp/glsp/issues/481

martin-fleck-at avatar Aug 26 '25 07:08 martin-fleck-at