Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(core): v2 route path should keep mounted in stats if error throws #13965

Merged
merged 1 commit into from
Dec 5, 2023

Conversation

TonyRL
Copy link
Collaborator

@TonyRL TonyRL commented Dec 5, 2023

Involved Issue / 该 PR 相关 Issue

koajs/mount#62 koajs/mount#69 koajs/mount#117

Example for the Proposed Route(s) / 路由地址示例

/test/error

Note / 说明

After this PR:

/test/1
/test/error

Yields:

  • Debug stats:
Hot Routes: 2  /test/:id
Hot Paths: 1  /test/error
           1  /test/1
           1  /
Hot Error Routes: 1  /test/:id
Hot Error Paths: 1  /test/error
  • Error message:
Looks like something went wrong
Route requested: /test/error
  • Console:
error: Error in /test/error: Error: Error test

Before this PR:

/test/1
/test/error

Yields:

  • Debug stats:
Hot Routes: 1  /test/:id
            1  /:id
Hot Paths: 1  /test/1
           1  /test/error
           1  /
Hot Error Routes: 1  /:id
Hot Error Paths: 1  /error
  • Error message:
Looks like something went wrong
Route requested: /error
  • Console:
error: Error in /error: Error: Error test

@github-actions github-actions bot added core enhancement Auto: Route Test Complete Auto route test has finished on given PR labels Dec 5, 2023
Copy link
Contributor

github-actions bot commented Dec 5, 2023

Successfully generated as following:

http://localhost:1200/test/error - Failed ❌
HTTPError: Response code 404 (Not Found)

Route requested: /test/error
Error message: Error: Error test
    at module.exports (/app/lib/v2/test/index.js:9:15)
    at dispatch (/app/node_modules/.pnpm/koa-compose@4.1.0/node_modules/koa-compose/index.js:42:32)
    at /app/node_modules/.pnpm/@koa+router@12.0.1/node_modules/@koa/router/lib/router.js:423:16
    at dispatch (/app/node_modules/.pnpm/koa-compose@4.1.0/node_modules/koa-compose/index.js:42:32)
    at /app/node_modules/.pnpm/koa-compose@4.1.0/node_modules/koa-compose/index.js:34:12
    at dispatch (/app/node_modules/.pnpm/@koa+router@12.0.1/node_modules/@koa/router/lib/router.js:428:31)
    at /app/node_modules/.pnpm/koa-mount@4.0.0/node_modules/koa-mount/index.js:58:11
    at dispatch (/app/node_modules/.pnpm/koa-compose@4.1.0/node_modules/koa-compose/index.js:42:32)
    at allowedMethods (/app/node_modules/.pnpm/@koa+router@12.0.1/node_modules/@koa/router/lib/router.js:483:12)
    at dispatch (/app/node_modules/.pnpm/koa-compose@4.1.0/node_modules/koa-compose/index.js:42:32)
Helpful Information to provide when opening issue:
Path: /test/error
Node version: v20.10.0
Git Hash: 94f0b1e

@TonyRL TonyRL force-pushed the fix/v2-with-namespace branch from 7311674 to 2eb1e41 Compare December 5, 2023 17:16
Copy link
Contributor

github-actions bot commented Dec 5, 2023

Successfully generated as following:

http://localhost:1200/test/error - Failed ❌
HTTPError: Response code 404 (Not Found)

Route requested: /test/error
Error message: Error: Error test
    at module.exports (/app/lib/v2/test/index.js:9:15)
    at dispatch (/app/node_modules/.pnpm/koa-compose@4.1.0/node_modules/koa-compose/index.js:42:32)
    at /app/node_modules/.pnpm/@koa+router@12.0.1/node_modules/@koa/router/lib/router.js:423:16
    at dispatch (/app/node_modules/.pnpm/koa-compose@4.1.0/node_modules/koa-compose/index.js:42:32)
    at /app/node_modules/.pnpm/koa-compose@4.1.0/node_modules/koa-compose/index.js:34:12
    at dispatch (/app/node_modules/.pnpm/@koa+router@12.0.1/node_modules/@koa/router/lib/router.js:428:31)
    at /app/node_modules/.pnpm/koa-mount@4.0.0/node_modules/koa-mount/index.js:58:11
    at dispatch (/app/node_modules/.pnpm/koa-compose@4.1.0/node_modules/koa-compose/index.js:42:32)
    at allowedMethods (/app/node_modules/.pnpm/@koa+router@12.0.1/node_modules/@koa/router/lib/router.js:483:12)
    at dispatch (/app/node_modules/.pnpm/koa-compose@4.1.0/node_modules/koa-compose/index.js:42:32)
Helpful Information to provide when opening issue:
Path: /test/error
Node version: v20.10.0
Git Hash: 7fbfe82

@TonyRL TonyRL force-pushed the fix/v2-with-namespace branch from 2eb1e41 to d64e71e Compare December 5, 2023 18:04
Copy link
Contributor

github-actions bot commented Dec 5, 2023

Successfully generated as following:

http://localhost:1200/test/error - Failed ❌
HTTPError: Response code 404 (Not Found)

Route requested: /test/error
Error message: Error: Error test
    at module.exports (/app/lib/v2/test/index.js:9:15)
    at dispatch (/app/node_modules/.pnpm/koa-compose@4.1.0/node_modules/koa-compose/index.js:42:32)
    at /app/node_modules/.pnpm/@koa+router@12.0.1/node_modules/@koa/router/lib/router.js:423:16
    at dispatch (/app/node_modules/.pnpm/koa-compose@4.1.0/node_modules/koa-compose/index.js:42:32)
    at /app/node_modules/.pnpm/koa-compose@4.1.0/node_modules/koa-compose/index.js:34:12
    at dispatch (/app/node_modules/.pnpm/@koa+router@12.0.1/node_modules/@koa/router/lib/router.js:428:31)
    at /app/node_modules/.pnpm/koa-mount@4.0.0/node_modules/koa-mount/index.js:58:11
    at dispatch (/app/node_modules/.pnpm/koa-compose@4.1.0/node_modules/koa-compose/index.js:42:32)
    at allowedMethods (/app/node_modules/.pnpm/@koa+router@12.0.1/node_modules/@koa/router/lib/router.js:483:12)
    at dispatch (/app/node_modules/.pnpm/koa-compose@4.1.0/node_modules/koa-compose/index.js:42:32)
Helpful Information to provide when opening issue:
Path: /test/error
Node version: v20.10.0
Git Hash: 5c8eb85

@TonyRL TonyRL merged commit 7dee6a8 into DIYgod:master Dec 5, 2023
30 of 33 checks passed
@TonyRL TonyRL deleted the fix/v2-with-namespace branch December 5, 2023 18:11
@TonyRL TonyRL mentioned this pull request Feb 14, 2024
12 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Auto: Route Test Complete Auto route test has finished on given PR core enhancement
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant