Implement Centralized Error Response Utility for CDN Service#5
Open
ItsHugoo wants to merge 11 commits intoparker110-crypto:817de48b-c2a1-40c7-b6bb-b7051fbe31b5from
Conversation
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 Centralized Error Response Utility for CDN Service
Description
Task
Develop a consistent error response mechanism for the CDN file retrieval service
Acceptance Criteria
Summary of Work
Overview
This pull request implements a robust and secure centralized error response utility for the CDN file retrieval service, providing a standardized approach to error handling and reporting.
Key Features
Implementation Details
Error Response Utility (
src/utils/error-response.ts)HttpStatusCodeenum for standardized HTTP status codesErrorResponseinterface for consistent error response structureErrorResponseUtilclass with the following methods:send(): Core method for sending standardized error responsessanitizeErrorMessage(): Prevents information leakage by redacting sensitive detailsnotFound()badRequest()internalServerError()Security Considerations
Testing Approach
Notes
Changes Made
Tests
Signatures
Staking Key
HtDSDViFnKSD9X2TD1kTZAtkF7xHJrjBLntr8z4BZpfb: 6ehfpP9Bri2XJMhbzSuDQiGSgKRDqfAtJmS4USbYvtKiFNfCCY66Gr7h3jw7YJ4rh14ThAsdR7wfrZP2Ctot2JUwGRgbkEqyjzmo6KGKwNFBtndpaKx1dESZmRcvAP7G1HUnHi35Qpn26EaYYNsfySwQac8wCcHXt9mfFPyzPRBPsVFxveMiPnpN2n2ppZ9vcjcuQjkKDpgVJqDYsE2rbuX7arzmYM6gqcxn8WsinFhHTX6MCLkGhboBjci4ZUGRnhgaUHq6eio91SoLxUsgX8qvpR2XcLnS5L4rAjt1x3x2KrcjupCRpgcyndUZsruAyHwsKH6MW7Gy2qJeJn4GRdxPMHe8NNhoi4BDpu4eeieLynyVhc62ZpPrKUDZKDBe23eaadDbAYg7gwEVJyDZVpM11PSo7NYip
Public Key
4g6jT7dSFNEy2NafTaQb6oe2M73jZjfznuz9WTfvKvyg: 2zhM4ohaDzC4UsfKBMtkktDwy1E6ZA5tK7Aaf2nms9A5S8TeQuGhfZrNyk9kw9q3DNpkAuBXx7FK8odybmW44Wf4i1K1brNVgwHiy7FbNEHzhgTFf6XhYoQX6KY4eYVbmh7uSAHXxigQSJZ8HCnH5ayFhy6NUiuEmYg55vAAT9jwTenuKMkxvNFQzHz5swseechEgvbZRXPKRZ4y4LBWTVBTmFdUF2uZHgiowAfBab6S4V5GXgJXRWKs1sS2yD4GCKKQvh73og5s7H1yGzzaNkiFvvD8K9k6NDFfHXsR7CgZsBNFoSZdXntFN1kVpbFgP896vKeayqHFgS3nnD7sq6vm3Pjq3QKxNjqAh4tPtC3hzkzEsCaUvk1FtqgD6uoKHvcTiSUXA5C27cEYCr3jbBvzYe8zbBjqe