mirror of
https://github.com/lensapp/lens.git
synced 2025-05-20 05:10:56 +00:00
Make error for invoking a functional global override more descriptive
Co-authored-by: Janne Savolainen <janne.savolainen@live.fi> Signed-off-by: Iku-turso <mikko.aspiala@gmail.com>
This commit is contained in:
parent
513e4a8193
commit
02dfbad307
@ -9,10 +9,16 @@ import { camelCase } from "lodash/fp";
|
|||||||
export const getGlobalOverrideForFunction = (
|
export const getGlobalOverrideForFunction = (
|
||||||
injectable: Injectable<Function, any, any>,
|
injectable: Injectable<Function, any, any>,
|
||||||
) =>
|
) =>
|
||||||
getGlobalOverride(injectable, () => (...args: any[]) => {
|
getGlobalOverride(injectable, (di) => (...args: any[]) => {
|
||||||
console.warn(
|
console.warn(
|
||||||
`Tried to invoke a function "${injectable.id}" without override. The args were:`,
|
`Tried to invoke a function "${injectable.id}" without override.`,
|
||||||
|
"\n\n",
|
||||||
|
"The args were:",
|
||||||
args,
|
args,
|
||||||
|
"\n\n",
|
||||||
|
`The context was: "${di.context
|
||||||
|
.map((x) => x.injectable.id)
|
||||||
|
.join(" -> ")}"`,
|
||||||
);
|
);
|
||||||
|
|
||||||
throw new Error(
|
throw new Error(
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user