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

统一error类型,确保所有异常都有对应的错误类型,引入gerror模块来实现 #38

Closed
su-chang opened this issue Jan 11, 2022 · 2 comments
Assignees

Comments

@su-chang
Copy link
Member

统一error类型,确保所有异常都有对应的错误类型

export default class WAError extends Error {

  constructor (type: WAErrorType, message: string) {
    super(`${type} ${message}`)
  }

}
@su-chang su-chang self-assigned this Jan 11, 2022
This was referenced Jan 11, 2022
@huan
Copy link
Member

huan commented Jan 11, 2022

Currently, the gerror module is used with the Wechaty ecosystem, it's very simple and straightforward, read the source code of it is recommended before continuing working on this issue.

GError source code: https:/huan/gerror/blob/main/src/gerror/gerror.ts
README: https:/huan/gerror

@su-chang su-chang changed the title 统一error类型,确保所有异常都有对应的错误类型 统一error类型,确保所有异常都有对应的错误类型,引入gerror模块来实现 Jan 11, 2022
@su-chang
Copy link
Member Author

Thanks for your suggestions. We will try it asap.

And happy to see Wechaty ecosystem become better and better.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants