dipdup-io / dipdup

Modular framework for creating selective indexers and featureful backends for dapps
https://dipdup.io
MIT License
92 stars 50 forks source link

A separate exception for SQL script failures #341

Open droserasprout opened 2 years ago

droserasprout commented 2 years ago

CallbackError is raised now. New exception should have a meaningful help message.

Josh-121 commented 6 days ago

I am applying to this issue via OnlyDust platform.

My background and how it can be leveraged

software/smart contract dev & contributor on onlydust

How I plan on tackling this issue

Identify the Current Exception:

Locate the current implementation where CallbackError is raised during SQL script failure. Review the code to understand the context and conditions that trigger this exception. Create a New Custom Exception:

Define a new custom exception class (e.g., SQLScriptExecutionError) that extends the base exception class. Include a detailed, meaningful error message to help users diagnose the failure. This message should provide insights into why the SQL script might have failed (e.g., syntax errors, missing tables, or connection issues). Enhance the Help Message:

Structure the help message to guide the user: What caused the failure (e.g., “The SQL script failed due to syntax error in line X”). Possible steps to troubleshoot (e.g., “Check for missing table or column in the query”). Link to documentation or references if applicable. Replace CallbackError with the New Exception:

Update the code to raise the new SQLScriptExecutionError with the custom help message where CallbackError was previously used. Testing:

Trigger the exception in different failure scenarios to ensure the error message is clear and informative. Verify that the new exception works seamlessly in both the logging and error handling processes.

Ndifreke000 commented 6 days ago

I am applying to this issue via OnlyDust platform.

My background and how it can be leveraged

My background in software development, particularly in SQL and open-source contributions, equips me with the skills necessary to effectively address this issue. I am committed to delivering high-quality code that improves user experience and enhances debugging processes.

How I plan on tackling this issue

I will start by locating the implementation where CallbackError is raised during SQL script failures, reviewing the code to understand the context and conditions that trigger this exception. Next, I’ll define a new custom exception class, such as SQLScriptExecutionError, which will extend the base exception class and include a detailed, meaningful error message to help users diagnose the failure, addressing potential causes like syntax errors or connection issues. The help message will be structured to guide users effectively by clearly stating what caused the failure (e.g., “The SQL script failed due to a syntax error in line X”), suggesting possible troubleshooting steps (e.g., “Check for missing tables or columns in the query”), and providing links to relevant documentation for further assistance. I will then update the code to raise SQLScriptExecutionError with the custom help message in place of CallbackError. Finally, I will simulate different failure scenarios to ensure the new exception provides clear and informative error messages while verifying that it integrates smoothly into the logging and error handling processes.

mamicho16 commented 5 days ago

I am applying to this issue via OnlyDust platform.

My background and how it can be leveraged

As a software developer with 3 years of professional experience. My background includes: Strong programming skills: I'm proficient in multiple programming languages and have experience in both front-end and back-end development. Experience with error handling and exception management: The issue described involves creating a custom exception for SQL script failures. I've implemented similar solutions in some works, improving error reporting and debugging processes. Database expertise: Working with SQL and database systems is a significant part of my daily responsibilities. I understand the intricacies of SQL script execution and the importance of proper error handling in database operations. Problem-solving skills: My experience has honed my ability to analyze issues, break them down into manageable parts, and implement effective solutions.

How I plan on tackling this issue

Implementing the new SQLScriptExecutionError exception with meaningful help messages. Refactoring the existing codebase to use the new exception where appropriate. Writing comprehensive unit tests to ensure the new error handling works as expected.

tosoham commented 5 days ago

I am applying to this issue via OnlyDust platform.

My background and how it can be leveraged

I am a python dev. A new-comer here, willing and ready to contribute to solve this issue.

Luluameh commented 5 days ago

I am applying to this issue via OnlyDust platform.

My background and how it can be leveraged

I have a solid background in Python and database handling. I’ve worked with SQL and error management, building custom exceptions to improve debugging and user experience

How I plan on tackling this issue

I’d create a new exception class for SQL failures, replacing CallbackError. The exception would include a detailed message to help identify the cause of the failure, with possible solutions.