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

feat(core): createRequestParamDecorator default support throw error #3656

Open
wants to merge 8 commits into
base: main
Choose a base branch
from

Conversation

mmdapl
Copy link
Contributor

@mmdapl mmdapl commented Feb 19, 2024

No description provided.

@codecov-commenter
Copy link

codecov-commenter commented Feb 19, 2024

Codecov Report

Attention: 1 lines in your changes are missing coverage. Please review.

Comparison is base (a3ca53b) 84.55% compared to head (666695f) 82.79%.
Report is 32 commits behind head on main.

❗ Current head 666695f differs from pull request most recent head 573a059. Consider uploading reports for the commit 573a059 to get more accurate results

Files Patch % Lines
packages/core/src/decorator/web/paramMapping.ts 94.73% 1 Missing ⚠️

❗ Your organization needs to install the Codecov GitHub app to enable full functionality.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #3656      +/-   ##
==========================================
- Coverage   84.55%   82.79%   -1.76%     
==========================================
  Files         491      491              
  Lines       46778    46766      -12     
  Branches     5601     5164     -437     
==========================================
- Hits        39551    38722     -829     
- Misses       7191     8021     +830     
+ Partials       36       23      -13     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

transform,
pipesOrOptions.pipes
);
if (pipesOrOptions.throwError == null) pipesOrOptions.throwError = true;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

这里还是 breaking 了,可以合到 4.x

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

可以的,先发你之前的小Patch吧

@mmdapl mmdapl changed the base branch from main to v4-next February 20, 2024 06:07
@mmdapl mmdapl changed the base branch from v4-next to main February 20, 2024 06:11
@czy88840616 czy88840616 added the status: Holding Same features may be hold, and implements layer. label Feb 20, 2024
@geekberryonekey
Copy link

这个 issue 和以下问题是同一个问题吗?

import { createRequestParamDecorator } from '@midwayjs/core';

// 实现装饰器
export const Token = () => {
  return createRequestParamDecorator(ctx => {
    throw new MidwayValidationError('Token params error', 422, null); // 这里会把 ctx 返回回去
  });
};

…m_decorator_throw_error

# Conflicts:
#	packages/core/src/decorator/web/paramMapping.ts
@mmdapl
Copy link
Contributor Author

mmdapl commented Oct 17, 2024

this PR can merge @czy88840616

@mmdapl
Copy link
Contributor Author

mmdapl commented Oct 17, 2024

这个 issue 和以下问题是同一个问题吗?

import { createRequestParamDecorator } from '@midwayjs/core';

// 实现装饰器
export const Token = () => {
  return createRequestParamDecorator(ctx => {
    throw new MidwayValidationError('Token params error', 422, null); // 这里会把 ctx 返回回去
  });
};

我依稀记得是装饰器里面抛错,throw不出来

@czy88840616
Copy link
Member

现在 main 还是 v3 啊

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
status: Holding Same features may be hold, and implements layer.
Development

Successfully merging this pull request may close these issues.

4 participants