vim-denops / denops.vim

🐜 An ecosystem of Vim/Neovim which allows developers to write cross-platform plugins in Deno
https://vim-denops.github.io/denops-documentation/
MIT License
674 stars 35 forks source link

Better error message for invalid API call #373

Closed lambdalisue closed 3 months ago

lambdalisue commented 3 months ago

Is your feature request related to a problem?

The following error message is not useful enough (e.g. #372)

Error invoking 'invoke' on channel 4 (denops):
TypeError: this[#denops].dispatcher[fn] is not a function
    at Plugin.call (file:///Users/uhooi/.local/share/nvim/lazy/denops.vim/denops/@denops-private/service.ts:176:45)
    at Service.#dispatch (file:///Users/uhooi/.local/share/nvim/lazy/denops.vim/denops/@denops-private/service.ts:88:25)
    at Service.dispatch (file:///Users/uhooi/.local/share/nvim/lazy/denops.vim/denops/@denops-private/service.ts:93:34)
    at invoke (file:///Users/uhooi/.local/share/nvim/lazy/denops.vim/denops/@denops-private/host.ts:78:22)
    at Object.invoke (file:///Users/uhooi/.local/share/nvim/lazy/denops.vim/denops/@denops-private/host/nvim.ts:31:16)
    at dispatch (https://deno.land/x/messagepack_rpc@v2.0.3/dispatcher.ts:36:36)
    at Session.#dispatch (https://deno.land/x/messagepack_rpc@v2.0.3/session.ts:244:28)
    at Session.#handleRequestMessage (https://deno.land/x/messagepack_rpc@v2.0.3/session.ts:271:53)
    at Session.#handleMessage (https://deno.land/x/messagepack_rpc@v2.0.3/session.ts:255:37)
    at Object.write (https://deno.land/x/messagepack_rpc@v2.0.3/session.ts:159:63)

Describe the solution you'd like

We should catch exception and re-throw with better message

Additional context