reclaimprotocol/reclaim-js-sdk
Improve and Standardize Error Handling and Logging Strategy
Open
#6 opened on Oct 1, 2024
enhancementgood first issuehacktoberfest
Repository metrics
- Stars
- (38 stars)
- PR merge metrics
- (PR metrics pending)
Description
Improve and Standardize Error Handling and Logging Strategy
Description
While we already use pino for logging in our SDK, our error handling approach is inconsistent across the codebase. We need to standardize our error handling and improve our use of the existing logging system to enhance debugging, error reporting, and overall reliability of the SDK. Some error messages donot provide the entire context on what caused the issue and what action user to take to solve the issue.
//eg: does not give us the entire information what can cause the identifier mismatch
//and there are no logs showing what is the expected identifier and what was the indetifier that was calculated
throw new ProofNotVerifiedError('Identifier Mismatch')
Goals
- Implement a consistent error handling mechanism across the SDK
- Standardize the use of the existing pino logger
- Create custom error types for better error identification
- Improve error messages for better developer experience
Current State
We currently use pino for logging: