From a060b45e9fad7d008ce090e19b6bad4aba0c0b66 Mon Sep 17 00:00:00 2001 From: EskiMojo14 Date: Mon, 12 Feb 2024 18:43:52 +0000 Subject: [PATCH] duplicate error message so it can get mangled --- packages/toolkit/src/query/createApi.ts | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/packages/toolkit/src/query/createApi.ts b/packages/toolkit/src/query/createApi.ts index ae3f6a24e0..f945956db1 100644 --- a/packages/toolkit/src/query/createApi.ts +++ b/packages/toolkit/src/query/createApi.ts @@ -356,14 +356,17 @@ export function buildCreateApi, ...Module[]]>( inject.overrideExisting !== true && endpointName in context.endpointDefinitions ) { - const errorMessage = `called \`injectEndpoints\` to override already-existing endpointName ${endpointName} without specifying \`overrideExisting: true\`` if (inject.overrideExisting === 'throw') { - throw new Error(errorMessage) + throw new Error( + `called \`injectEndpoints\` to override already-existing endpointName ${endpointName} without specifying \`overrideExisting: true\``, + ) } else if ( typeof process !== 'undefined' && process.env.NODE_ENV === 'development' ) { - console.error(errorMessage) + console.error( + `called \`injectEndpoints\` to override already-existing endpointName ${endpointName} without specifying \`overrideExisting: true\``, + ) } continue