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

Enhancement: Implement Uniform Error Handling in lib Scripts #16

Open
babblebey opened this issue Apr 1, 2024 · 0 comments
Open

Enhancement: Implement Uniform Error Handling in lib Scripts #16

babblebey opened this issue Apr 1, 2024 · 0 comments
Labels
↗️ medium priority This issue is crucial 🐛 bug Something isn't working ✨ enhancement New feature or request

Comments

@babblebey
Copy link
Member

babblebey commented Apr 1, 2024

The lib scripts in the src/lib directory currently have inconsistent error handling practices. Some functions throws the erros correctly using throw in the catch block of the try...catch, while some uses console.log in catch blocks, and some others lack try...catch blocks altogether. To improve the maintainability and reliability of our codebase, we should implement try...catch blocks in all functions within the lib scripts and ensure that errors are thrown uniformly.

Scope of Work:

  1. Implement try...catch blocks in all functions within the src/lib directory.
  2. Ensure that errors are thrown uniformly using the throw keyword in catch blocks.
  3. Review existing console.log statements in catch blocks and replace them with appropriate error throwing.

Additional Considerations:

  • Use descriptive error messages to provide meaningful information about the encountered issue.
  • Follow a consistent format for error messages to make them easily identifiable and understandable.
  • Consider creating a utility function for error handling to avoid code duplication and ensure uniformity.

Submission Guidelines:

  • Ensure that all functions within the src/lib directory have proper try...catch blocks implemented.
  • Review and refactor existing error handling code to adhere to the new uniform error throwing approach.

Addition Information:

  • Kindly work only on replacing the console.log in the catch block of the try..catch; Its important to not remove the console.log in the try blocks or anywhere else for now.
  • Are you thinking of a logger!? 😜 great thought, but we don't really want that yet (atleast at the time I write this issue), it might be an overkill... If anything changes, we will communicate this 👍
@babblebey babblebey added 🐛 bug Something isn't working ✨ enhancement New feature or request ↗️ medium priority This issue is crucial labels Apr 1, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
↗️ medium priority This issue is crucial 🐛 bug Something isn't working ✨ enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant