From d96aea3ac590139bb514f23a45dac0620989e82a Mon Sep 17 00:00:00 2001 From: Nicolas Beaussart Date: Tue, 17 Oct 2023 10:45:55 +0200 Subject: [PATCH] Apply suggestions from code review Co-authored-by: Lars Kappert --- README.md | 2 +- src/ConfigurationChief.ts | 2 +- src/util/unwrapFunction.ts | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index 6746a4f86..75ea3a406 100644 --- a/README.md +++ b/README.md @@ -125,7 +125,7 @@ const config: KnipConfig = { export default config; ``` -And if you need, you can also expose a function or an async function if you need, like so : +And if you need, you can also expose an (async) function if you need, like so: ```ts import type { KnipConfig } from 'knip'; diff --git a/src/ConfigurationChief.ts b/src/ConfigurationChief.ts index 1de8d44c3..ab0c99cab 100644 --- a/src/ConfigurationChief.ts +++ b/src/ConfigurationChief.ts @@ -167,7 +167,7 @@ export class ConfigurationChief { try { return await unwrapFunction(loadedValue); } catch (e) { - throw new ConfigurationError(`Unable to run the function from the knip config file`); + throw new ConfigurationError(`Error running the function from ${configPath}`); } } diff --git a/src/util/unwrapFunction.ts b/src/util/unwrapFunction.ts index 0ff20b3a4..7044613f4 100644 --- a/src/util/unwrapFunction.ts +++ b/src/util/unwrapFunction.ts @@ -5,7 +5,7 @@ export const unwrapFunction = async (possibleFunction: unknown) => { try { return await possibleFunction(); } catch (error) { - debugLogObject('Error executing function:', error); + debugLogObject('*', 'Error executing function:', error); throw error; } }