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

Describe error handling best practice in Code Style and Quality Guide #52

Open
tisonkun opened this issue Jul 17, 2021 · 0 comments
Open
Labels
good first issue Good for newcomers help wanted Extra attention is needed

Comments

@tisonkun
Copy link
Contributor

The best practices of reporting errors:

  1. The error message should be more user-friendly. Bad case: The table 101 exceeds table size. Good case: The table tbl exceeds table size.
  2. Provide workarounds if necessary. Bad case: The table tbl exceeds table size. Good case: The table tbl exceeds table size. Please try to turn up the value of the system variable tmp_table_size.
  3. Define an error code when it's a general error. Bad case: The table tbl exceeds table size. Good case: Error 1001: The table tbl exceeds table size.
  4. Report the error as early as possible. If you can judge it in the preprocess phase, don't report it in the planner phase. If you can judge it in the planner phase, don't report it in the executor phase. The premise is not breaking the readability and simplicity of the code.

Originally posted by @djshow832 in #26 (comment)

@tisonkun tisonkun added good first issue Good for newcomers help wanted Extra attention is needed labels Jul 17, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
good first issue Good for newcomers help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

1 participant