Open fishonamos opened 3 days ago
I am applying to this issue via OnlyDust platform.
I am a fullstack developer worked with various frontend frameworks over the years as well as different backend languages. currently transitioning into the web3 space.
Can i be assigned this task!?
I am applying to this issue via OnlyDust platform.
I am a full-stack developer with experience in QA testing and languages like Python, Cairo, Solidity, React, and JavaScript.
i will Use meaningful error codes and messages. Document custom error classes and codes. Consistently handle and log errors.
I am applying to this issue via OnlyDust platform.
Hello @fishonamos, I would love to handle this
First, i Will Create a new file errors.js
in the middlewarefoled
Then, Create the basic error class:
class AppError extends Error {
constructor(code, message, statusCode = 500) {
super(message);
this.code = code;
this.statusCode = statusCode;
}
}
Add a few specific error types:
class ValidationError extends AppError {
constructor(message) {
super('VALIDATION_ERROR', message, 400);
}
}
class NotFoundError extends AppError { constructor(message) { super('NOT_FOUND', message, 404); } }
4. Add error handler middleware (if using Express):
```javascript
const errorHandler = (err, req, res, next) => {
if (err instanceof AppError) {
return res.status(err.statusCode).json({
code: err.code,
message: err.message
});
}
return res.status(500).json({
code: 'INTERNAL_ERROR',
message: 'An unexpected error occurred'
});
};
I am applying to this issue via OnlyDust platform.
I am a web3 developer, I have expertise in smart contracts, decentralized technologies, and frameworks like React. I can build innovative dApps, contribute to open-source projects, educate others, and network with industry leaders to advance my career in the decentralized space.
Create a custom error class that extends the base Error class, incorporating properties for error codes, messages, and any additional relevant data. Implement this custom error class in the app/server wherever specific error handling is needed, ensuring that informative error messages are generated. Test the implementation to verify that it provides granular error handling and improves code readability.
I am applying to this issue via OnlyDust platform.
Hi, I'm Josué Brenes and I'll be working on issue. I'm Dojo Coding member.
I estimate this will take 3 day to complete.
Here’s how I would tackle this issue:
Create a custom error class:
Error
class in JavaScript or TypeScript. This custom error class will have additional properties for handling specific error codes, messages, and any other relevant data needed to provide more context in error scenarios.errorCode
: A specific code that identifies the error type.message
: A detailed message to provide more information about the error.details
: Any additional data (like the failed request data, or user info) that might help with debugging.Integrate the custom error class within the app/server:
Improve error message readability:
Test the custom error handling:
Completion Criteria:
I am applying to this issue via OnlyDust platform.
Create and Use a Custom Error Class in app/server
Hello LandVer team,
I am Joel Vargas, and I'm a member of Dojo Coding. I also come from OnlyDust.
I would like to request the assignment of this issue. Below is my proposed approach for implementing this issue:
Currently, the app/server may utilize generic error handling, which can lead to ambiguity and make it difficult to identify specific error scenarios. This lack of granularity can hinder debugging efforts and reduce code readability. A custom error class will allow us to handle errors more effectively and provide clearer feedback in various parts of the application.
To enhance error handling, I propose the development of a custom error class that extends the base Error
class or utilizes a suitable error handling library. This custom error class will provide structured error information, improving the overall maintainability of the codebase.
Custom Error Class Implementation:
Error
class.errorCode
, errorMessage
, and additionalData
to encapsulate relevant error information.Granular Error Handling:
Informative Error Messages:
Custom Error Class Definition:
Create a new file (e.g., CustomError.js
) to define the custom error class:
class CustomError extends Error {
constructor(errorCode, errorMessage, additionalData = null) {
super(errorMessage);
this.name = this.constructor.name;
this.errorCode = errorCode;
this.additionalData = additionalData;
Error.captureStackTrace(this, this.constructor);
}
}
export default CustomError;
Using the Custom Error Class:
Replace existing error handling logic with the custom error class in relevant parts of the app/server. For example:
import CustomError from './CustomError';
function someFunction() {
try {
// Some operation that might fail
throw new CustomError('USER_NOT_FOUND', 'The specified user does not exist', { userId: 123 });
} catch (error) {
if (error instanceof CustomError) {
console.error(`Error Code: ${error.errorCode}, Message: ${error.message}`);
} else {
console.error('An unexpected error occurred:', error);
}
}
}
Testing and Validation:
The project will be considered complete when:
Error
class or a suitable error handling library.errorCode
, errorMessage
, and additionalData
.I am applying to this issue via OnlyDust platform.
hello @ i'm an experienced frontend developer and a blockchain developer i would love to work on this issue Pleasee kindly assign :)
I am applying to this issue via OnlyDust platform.
i am a cerfield full stack developer with half a decade years of experience in developing professional apps and webpages
I will approach the problem using this steps
2.Integrating the Custom Error Class in the Application In relevant parts of the app/server, I would use this custom error class to throw specific errors. For example, in routes or middleware, I would throw CustomError for cases like invalid input, unauthorized access, etc.
Testing and Usage Ensure the CustomError is used wherever errors are thrown in the app (e.g., API routes, services, etc.). Test the error handling with various scenarios, such as unauthorized access, invalid inputs, or other business logic failures. Confirm that meaningful messages and appropriate status codes are returned.
I am applying to this issue via OnlyDust platform.
Hi, I'm Collins a frontend and blockchain developer, and an active contributor on OnlyDust. You can check out my profile here: https://app.onlydust.com/u/0xdevcollins. This is my first time contributing to this repository, and I’m excited about the opportunity to contribute. Looking forward to collaborating!
I'll develop a custom error class that extends the base Error class, adding properties like error codes and additional data for improved specificity. It will be implemented in relevant sections of the app/server to provide more detailed error messages, enhancing both error handling and code clarity.
I am applying to this issue via OnlyDust platform.
Hi, please can I be assigned this please? This would be my first time contributing to this project and I would love to be the given the opportunity to contribute. I have experience in html, css, JavaScript,TypeScript and solidity, and Cairo.
To solve this issue, I’ll take the following steps:
Please assign me, I’m ready to work.
I am applying to this issue via OnlyDust platform.
Hello, I'm Dprof-in-tech, a seasoned Full Stack Blockchain Developer, and I'm excited to be part of ODHACK 9! I have a strong foundation in technologies such as Next.js, TypeScript, JavaScript, React, Node.js, Rust, and Cairo, I've built extensive experience across the blockchain development landscape.
I first got involved with OnlyDust during Edition 2, and since then, I've made 39 contributions across 11 different projects. Working on the platform has really helped me sharpen my skills, especially when it comes to delivering great solutions under tight deadlines. I love combining technical know-how with a user-focused approach, whether it's building immersive 3D experiences or crafting smart contracts that solve real-world problems.
Throughout, I've consistently demonstrated the ability to adapt and contribute effectively to diverse challenges. I'm confident in my ability to tackle new problems and drive innovation within the blockchain space. As we kick off ODHACK 9, I'm eager to apply my previous experience and technical expertise to push the boundaries of what's possible.
You can view my public profile on OnlyDust here: https://app.onlydust.com/u/Dprof-in-tech
Approach for Issue #90: Create and Use a Custom Error Class in app/server
This is a sample of what it could look like:
class CustomError extends Error { constructor(message, errorCode, data = null) { super(message); this.name = this.constructor.name; this.errorCode = errorCode; this.data = data; Error.captureStackTrace(this, this.constructor); } }
This is a conceptual implementation of what it could look like. if (!user) { throw new CustomError("User not found", 404, { userId }); }
Enhance Error Handling: I’ll ensure that all places where errors are caught (e.g., middleware, controllers) are updated to handle the new custom error class. This includes logging the error code and any additional data provided to the error class. For server responses, I’ll ensure the user sees clear, helpful error messages without exposing sensitive information.
Testing and Validation: I’ll write test cases to validate that the custom error class works as expected. I’ll test both typical and edge cases to ensure the class captures errors correctly and that error messages are clear in various scenarios.
Documentation and Best Practices: I’ll document the usage of the custom error class, outlining where and how to use it in the codebase. This will help ensure that future developers follow a consistent pattern for error handling, leading to better maintainability.
Expected time of delivery : 3-4 days
I am applying to this issue via OnlyDust platform.
i have proper frontend experience, and looking forward to contribute to this repo
i would follow exactly what is mentioned and give you apt results.
I am applying to this issue via OnlyDust platform.
I am Santiago Villarreal Arley, a passionate software developer with a growing interest in Web3 technologies. Over the past few months, I've had the opportunity to work on innovative projects, such as BuildMyEvent, an open-source initiative that leverages blockchain and decentralized systems. I thrive on problem-solving and enjoy the challenge of integrating cutting-edge solutions into real-world applications. My goal is to contribute to the Web3 ecosystem by staying ahead of emerging trends, learning continuously, and developing projects that push the boundaries of decentralized technologies.
I would love to contribute to developing a custom error class for handling specific error scenarios within the app/server. Here’s my approach:
Class Creation:
I will create a custom error class that extends the base Error class or a suitable error handling library, depending on the current project setup. This will allow for more structured error management. Custom Properties:
The class will include additional properties such as errorCode, message, and possibly extra data like metadata or context, which can provide more detailed information about the error. Implementation in the App:
I will integrate the custom error class into the relevant parts of the app/server where specific error handling is required. This will allow for more precise error identification and messaging, which will enhance both debugging and user feedback. Error Handling Improvements:
By using this custom class, we can differentiate between different types of errors (e.g., validation errors, database errors) and improve the overall code readability and maintainability. It will also provide more informative error messages for both developers and users.
I’m excited to contribute to this feature and help improve the app's error handling capabilities!
Description: Develop a custom error class to handle specific error scenarios within the app/server. This will provide more granular error handling and improve code readability.
Definition of Completion: A custom error class is created, extending the base Error class or a suitable error handling library. The class includes properties for error codes, messages, and potential additional data. The custom error class is used in relevant parts of the app/server to handle specific error conditions, and more informative error messages.
Note: Only applications through the OnlyDust platform will be considered.