mirror of
https://gitcode.com/gh_mirrors/hy/Hydro.git
synced 2026-10-19 17:38:19 +08:00
使用 @param 验证接口
This commit is contained in:
1 parent
4e85b696c0
commit
19cf1a5304
22 files changed
+657
-393
No files matched your search
+2
-5
@@ -31,6 +31,8 @@ const Err = (name: string, ...info: Array<IHydroError | Function | string | numb
|
||||
export class HydroError extends Error {
|
||||
params: any[];
|
||||
|
||||
code: number;
|
||||
|
||||
constructor(...params: any[]) {
|
||||
super();
|
||||
this.params = params;
|
||||
@@ -40,11 +42,6 @@ export class HydroError extends Error {
|
||||
msg() {
|
||||
return 'HydroError';
|
||||
}
|
||||
|
||||
// eslint-disable-next-line class-methods-use-this
|
||||
code() {
|
||||
return 500;
|
||||
}
|
||||
}
|
||||
|
||||
export const UserFacingError = Err('UserFacingError', HydroError, 'UserFacingError', 400);
|
||||
|
||||
Reference in new issue
Block a user