From a8b777249f8af4f722b91eba06009c952beb88f4 Mon Sep 17 00:00:00 2001 From: Markus Blomqvist Date: Tue, 24 Sep 2024 21:05:48 +0300 Subject: [PATCH] Silence `findConfig` errors A custom error handling/logging was previously added to log any errros for importing routes during the OpenAPI path generation. For finding the correct docs handler to pull the NRF config from, that handling is not needed and it may often result to a lot of visible errors for the user, so we remove that in this commit. --- packages/next-rest-framework/src/cli/utils.ts | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/packages/next-rest-framework/src/cli/utils.ts b/packages/next-rest-framework/src/cli/utils.ts index 99d1e99..38f8b95 100644 --- a/packages/next-rest-framework/src/cli/utils.ts +++ b/packages/next-rest-framework/src/cli/utils.ts @@ -83,8 +83,8 @@ export const findConfig = async ({ configPath }: { configPath?: string }) => { }); } } - } catch (e) { - logGenerateErrorForRoute(getRouteName(route), e); + } catch { + // The route was not a docs route. } }) ); @@ -128,8 +128,8 @@ export const findConfig = async ({ configPath }: { configPath?: string }) => { config: _config }); } - } catch (e) { - logGenerateErrorForRoute(getApiRouteName(route), e); + } catch { + // The API route was not a docs API route. } }) );