Skip to content

Commit

Permalink
fix: remove errorException
Browse files Browse the repository at this point in the history
  • Loading branch information
Milly committed Apr 14, 2024
1 parent 54d53fb commit cbca2bb
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 45 deletions.
13 changes: 2 additions & 11 deletions denops/ddu/ddu.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down Expand Up @@ -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);
}
}
})();
Expand Down
32 changes: 6 additions & 26 deletions denops/ddu/ext.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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<BaseSourceParams, unknown>;
Expand Down Expand Up @@ -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);
}
}

Expand Down Expand Up @@ -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);
}
}

Expand Down Expand Up @@ -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);
}
}
});
Expand All @@ -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);
}
}

Expand All @@ -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);
}
}

Expand Down
8 changes: 0 additions & 8 deletions denops/ddu/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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<Deno.FileInfo | null> {
// NOTE: Deno.stat() may be failed
try {
Expand Down

0 comments on commit cbca2bb

Please sign in to comment.