diff --git a/denops/ddu/ddu.ts b/denops/ddu/ddu.ts index 6e5b504..ff67127 100644 --- a/denops/ddu/ddu.ts +++ b/denops/ddu/ddu.ts @@ -35,12 +35,7 @@ import { } from "./context.ts"; import { defaultSourceOptions } from "./base/source.ts"; import { Loader } from "./loader.ts"; -import { - convertUserString, - errorException, - printError, - treePath2Filename, -} from "./utils.ts"; +import { convertUserString, printError, treePath2Filename } from "./utils.ts"; import { AvailableSourceInfo, GatherState, @@ -568,11 +563,7 @@ export class Ddu { // Aborted by signal, so do nothing. } else { // Show error message - errorException( - denops, - e, - `source: ${source.name} "gather()" failed`, - ); + printError(denops, `source: ${source.name} "gather()" failed`, e); } } })(); diff --git a/denops/ddu/ext.ts b/denops/ddu/ext.ts index a5cce31..cd49e50 100644 --- a/denops/ddu/ext.ts +++ b/denops/ddu/ext.ts @@ -54,7 +54,7 @@ import { defaultColumnOptions } from "./base/column.ts"; import { defaultKindOptions } from "./base/kind.ts"; import { defaultActionOptions } from "./base/action.ts"; import { Loader } from "./loader.ts"; -import { convertUserString, errorException, printError } from "./utils.ts"; +import { convertUserString, printError } from "./utils.ts"; type ItemActions = { source: BaseSource; @@ -547,11 +547,7 @@ export async function callFilters( items = ret.items; } } catch (e: unknown) { - await errorException( - denops, - e, - `filter: ${filter.name} "filter()" failed`, - ); + await printError(denops, `filter: ${filter.name} "filter()" failed`, e); } } @@ -889,11 +885,7 @@ async function checkUiOnInit( ui.isInitialized = true; } catch (e: unknown) { - await errorException( - denops, - e, - `ui: ${ui.name} "onInit()" failed`, - ); + await printError(denops, `ui: ${ui.name} "onInit()" failed`, e); } } @@ -975,11 +967,7 @@ export async function uiRedraw< // Ignore "E523: Not allowed here" errors await denops.call("ddu#_lazy_redraw", options.name); } else { - await errorException( - denops, - e, - `ui: ${ui.name} "redraw()" failed`, - ); + await printError(denops, `ui: ${ui.name} "redraw()" failed`, e); } } }); @@ -1004,11 +992,7 @@ async function checkFilterOnInit( filter.isInitialized = true; } catch (e: unknown) { - await errorException( - denops, - e, - `filter: ${filter.name} "onInit()" failed`, - ); + await printError(denops, `filter: ${filter.name} "onInit()" failed`, e); } } @@ -1031,11 +1015,7 @@ async function checkColumnOnInit( column.isInitialized = true; } catch (e: unknown) { - await errorException( - denops, - e, - `column: ${column.name} "onInit()" failed`, - ); + await printError(denops, `column: ${column.name} "onInit()" failed`, e); } } diff --git a/denops/ddu/utils.ts b/denops/ddu/utils.ts index f04e398..739a2f0 100644 --- a/denops/ddu/utils.ts +++ b/denops/ddu/utils.ts @@ -22,14 +22,6 @@ export async function printError( await denops.call("ddu#util#print_error", message); } -export async function errorException( - denops: Denops, - e: unknown, - message: string, -) { - await printError(denops, message, e); -} - export async function safeStat(path: string): Promise { // NOTE: Deno.stat() may be failed try {