import { friendlyCall } from "https://deno.land/x/denops_std@v4.1.3/helper/mod.ts";
Call given function and print a friendly error message (without stack trace) on failure.
It's mainly designed for dispatcher
functions.
Print a stack trace when denops is running in debug mode.
import { Denops } from "../mod.ts";
import { friendlyCall } from "../helper/mod.ts";
export async function main(denops: Denops): Promise<void> {
denops.dispatcher = {
say: () => {
return friendlyCall(denops, async () => {
// Do whatever you want.
throw new Error("Some error occurred");
});
},
};
}
Parameters
denops: Denops