Skip to content

Commit d803758

Browse files
committed
refactor(errors): improve pathFilter error message
1 parent 2ada306 commit d803758

File tree

2 files changed

+3
-2
lines changed

2 files changed

+3
-2
lines changed

CHANGELOG.md

+1
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
## [next](https://github.com/chimurai/http-proxy-middleware/releases)
44

55
- fix(type): fix RequestHandler return type
6+
- refactor(errors): improve pathFilter error message
67

78
## [v3.0.0](https://github.com/chimurai/http-proxy-middleware/releases/tag/v3.0.0)
89

src/errors.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
export enum ERRORS {
22
ERR_CONFIG_FACTORY_TARGET_MISSING = '[HPM] Missing "target" option. Example: {target: "http://www.example.org"}',
3-
ERR_CONTEXT_MATCHER_GENERIC = '[HPM] Invalid context. Expecting something like: "/api" or ["/api", "/ajax"]',
4-
ERR_CONTEXT_MATCHER_INVALID_ARRAY = '[HPM] Invalid pathFilter. Expecting something like: ["/api", "/ajax"] or ["/api/**", "!**.html"]',
3+
ERR_CONTEXT_MATCHER_GENERIC = '[HPM] Invalid pathFilter. Expecting something like: "/api" or ["/api", "/ajax"]',
4+
ERR_CONTEXT_MATCHER_INVALID_ARRAY = '[HPM] Invalid pathFilter. Plain paths (e.g. "/api") can not be mixed with globs (e.g. "/api/**"). Expecting something like: ["/api", "/ajax"] or ["/api/**", "!**.html"].',
55
ERR_PATH_REWRITER_CONFIG = '[HPM] Invalid pathRewrite config. Expecting object with pathRewrite config or a rewrite function',
66
}

0 commit comments

Comments
 (0)