-
Notifications
You must be signed in to change notification settings - Fork 15
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Enhance error handling and add error tests in graph package (#127)
* Enhance error handling and add error tests in graph package This commit improves error handling throughout the graph package by: 1. Adding detailed error wrapping using fmt.Errorf with %w verb in the Cache function to provide better error context and maintain error chain 2. Adding comprehensive error injection capabilities to MockStorage by: - Adding error fields for each operation - Implementing error checks in all mock methods - Improving error handling in mock methods 3. Adding TestCacheErrors test suite that verifies error handling for: - ToBeCached errors - GetAllKeys errors - GetNodes errors - SaveCaches errors - ClearCacheStack errors 4. Improving MockStorage implementation: - Better initialization of internal maps - More consistent error handling patterns - Cleaner key construction for custom data - Added existence checks for data retrieval These changes improve debuggability by providing more context in error messages and increase test coverage around error conditions. Signed-off-by: naveensrinivasan <172697+naveensrinivasan@users.noreply.github.com> * Ignoring the mockgraph coverage Signed-off-by: naveensrinivasan <172697+naveensrinivasan@users.noreply.github.com> --------- Signed-off-by: naveensrinivasan <172697+naveensrinivasan@users.noreply.github.com>
- Loading branch information
1 parent
4c6c3d1
commit dd3d7f6
Showing
4 changed files
with
160 additions
and
26 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters