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

Exception and Error Handling #1150

Open
madhavipuliraju opened this issue May 29, 2019 · 0 comments
Open

Exception and Error Handling #1150

madhavipuliraju opened this issue May 29, 2019 · 0 comments

Comments

@madhavipuliraju
Copy link

madhavipuliraju commented May 29, 2019

Please find the best practices for handling and creating exceptions.

  1. Use try/catch/finally blocks to recover from errors or release resources
  2. Handle common conditions without throwing exceptions
  3. Design classes so that exceptions can be avoided
  4. Throw exceptions instead of returning an error code
  5. Use the predefined exception types
  6. Use grammatically correct error messages
  7. In custom exceptions, provide additional properties as needed
  8. Restore state when methods don't complete due to exceptions
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

1 participant