Implement Comprehensive Error Handling for Product Search Endpoint - #5
Open
HermanKoii wants to merge 5 commits into
Conversation
HermanKoii
marked this pull request as ready for review
June 6, 2025 02:05
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Implement Comprehensive Error Handling for Product Search Endpoint
Description
Task
Add comprehensive error handling for search endpoint
Acceptance Criteria
Summary of Work
Overview
This pull request adds robust error handling to the product search functionality, ensuring clear and informative error responses for various search scenarios.
Changes Made
SearchService.search()methodsearchErrors.tsImplementation Details
Error Classes (
src/searchErrors.ts)SearchErrorwith standardized error handlingInvalidQueryError: Handles empty or malformed queriesEmptyResultError: Manages scenarios with no matching productsSearchParamError: Validates search parameter constraintsSearch Service Improvements (
src/searchService.ts)Error Handling Scenarios
Testing Approach
Notes
Changes Made
Tests
Signatures
Staking Key
G79TK8ccVx11JCsStBY85thohoSCm5eDwACAVju4z7bj: T9MyWnKG4RGzbgqKfMewUcwGc7AxXjy8T68B3bzpubN4S46FQMYPzFC12sBAkNiLa5Ebv8r9tzjU7gEMPK29umYuqzCwv1YMNQ94dVwcJ3j88ejQfuXVjiDW1zzkPcLkn7VfREVypC54Rp5qZNrQdYqeSXFkUMCQNEUWHrWmRFRtEApkbq48BieKDogWsKkxMMLJVFXpyUZtHu6CDnG4hvNQyxT9XDQPZhJBtNi6ynd9Xj6EHtDwvWbkCVGE4J1DVPeZH4Lvuk1qpQEjuSNkwAWDFJ7YjEoocCQqkqi3qDFLXCdbVLxMSgJnL7VX9BGHf8wcom5tBB419jUNKtg2uah3QSna7AuDhCQ93DUReuuMKyyX5y9W6UzAcjUzZvpp17QmEiWWzRcjwcSyxqhbMyGRGo1TzX8ds2
Public Key
3Zfb8hhM5g8ZC7nqNKELNBByLSP56s6gqGNc8RWB6PgP: WTeVRz9bK36DXEUdshWnCuAGTmCGU2KJXrSaANf7sTZ18Pp3Fr9NEoR666T87gSBKzi6AdK1hRqk7TpjDoTG65u7Q6RYXq9V2K48ppdSXKCCehEe5r9WCvVaqWNjcJc2p9izTGp1FFap4KkWAPfbEQZEM352YPWHGU2aAepFVrPWnCn6WvPjABxuDKG6PtX47SjmfQNWHF33AV7fzDxWG7M1znPSEwELQThxFajy8WZA9bfZvJGRvP53yvfe1pjJh7cJaX6gntevchDtLqsn2uDhnP491Y6TjYbf7JdUEfDiq4hoxPegkt5G2ipmMgUKoHLEraEyyMd8q25vRonjV6jnNa2i7yMPbMRGgANEGfnFag7By99wKco28ebYMMHU1wcxs8t7JaaAadvcoi7M3hZjCnEhrpNFUG