chore: update error message

This commit is contained in:
Kamil Myśliwiec
2024-12-18 12:06:36 +01:00
parent bc1a992918
commit 969a35bc51
2 changed files with 2 additions and 2 deletions

View File

@@ -1,7 +1,7 @@
import { Logger } from '@nestjs/common';
const UNSUPPORTED_PATH_MESSAGE = (text: TemplateStringsArray, route: string) =>
`Unsupported route path: "${route}". In previous versions, the symbols ?, *, and + were used to denote optional or repeating path parameters. The latest version of "path-to-regexp" now requires the use of named parameters. For example, instead of using a route like /users/* to capture all routes starting with "/users", you should use /users/*path. For more details, refer to the migration guide.`;
`Unsupported route path: "${route}". In previous versions, the symbols ?, *, and + were used to denote optional or repeating path parameters. The latest version of "path-to-regexp" now requires the use of named parameters. For example, instead of using a route like /users/* to capture all routes starting with "/users", you should use /users/{*path}. For more details, refer to the migration guide.`;
export class LegacyRouteConverter {
private static readonly logger = new Logger(LegacyRouteConverter.name);

View File

@@ -279,7 +279,7 @@ export class RouterExplorer {
} catch (e) {
if (e instanceof TypeError) {
this.logger.error(
`Unsupported host "${host}" syntax. In past releases, ?, *, and + were used to denote optional or repeating path parameters. The latest version of "path-to-regexp" now requires the use of named parameters. For example, instead of using a route like /users/* to capture all routes starting with "/users", you should use /users/*path. Please see the migration guide for more information.`,
`Unsupported host "${host}" syntax. In past releases, ?, *, and + were used to denote optional or repeating path parameters. The latest version of "path-to-regexp" now requires the use of named parameters. For example, instead of using a route like /users/* to capture all routes starting with "/users", you should use /users/{*path}. Please see the migration guide for more information.`,
);
}
throw e;