-
Notifications
You must be signed in to change notification settings - Fork 3
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: support short name for HTTP Errors #8
Conversation
e.g.: - NotFoundError alias to E404 - ImATeapotError alias to E418
Codecov Report
@@ Coverage Diff @@
## master #8 +/- ##
=====================================
Coverage 100% 100%
=====================================
Files 50 50
Lines 342 342
Branches 48 48
=====================================
Hits 342 342
Continue to review full report at Codecov.
|
|
||
it('should alias to short name E416', () => { | ||
const err = new E416(); | ||
assert(err.code === 'RANGE_NOT_SATISFIABLE'); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
code 是否统一加 ERR_EGG_HTTP_
前缀比较好呢?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
可以加个前缀,不过要发个大版本
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
那还是这样吧,目前 code 也没有系统性收集。
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
问题应该也不大,如果我们后面要供统一的处理方法。只需要保证在 egg-errors 体系内的错误码不重复定义就好了。
@popomore 来合并?或者给我加一下权限 |
|
e.g.: