Feat/mkt 11337 error hosting support#139
Merged
Amitkanswal merged 6 commits intodevelopfrom Apr 4, 2025
Merged
Conversation
Signed-off-by: Amitkanswal <amitkanswal7@gmail.com>
Signed-off-by: Amitkanswal <amitkanswal7@gmail.com>
Signed-off-by: Amitkanswal <amitkanswal7@gmail.com>
There was a problem hiding this comment.
Pull Request Overview
This PR refactors the API adapter and error handling logic to support improved error hosting while extending endpoint configuration.
- Refactored API adapter functions and error handling in axios utilities.
- Updated region handling and introduced endpoint configurations in UI location and type definitions.
- Adjusted tests to cover the new endpoints and region behavior.
Reviewed Changes
Copilot reviewed 12 out of 12 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| src/utils/utils.ts | Added sanitizeResponseHeader and handleApiError functions for improved error handling. |
| src/utils/adapter.ts | Updated dispatchAdapter and dispatchApiRequest to leverage new error handling. |
| src/uiLocation.ts | Integrated endpoints property and updated region typing. |
| src/types/api.type.ts & src/types.ts | Extended type definitions to support endpoints and additional region values. |
| test/* | Updated tests to require endpoints and new region behavior. |
Comments suppressed due to low confidence (1)
src/types.ts:259
- [nitpick] Ensure that the newly introduced enum value 'GCP_EU' is consistent with the existing naming conventions and intended region identifiers throughout the codebase.
GCP_EU = "GCP_EU",
Signed-off-by: Amitkanswal <amitkanswal7@gmail.com>
Signed-off-by: Amitkanswal <amitkanswal7@gmail.com>
There was a problem hiding this comment.
Pull Request Overview
This PR refactors the API adapter and error handling logic to improve error processing and support for dynamic endpoints.
- Refactored utility functions to include a header conversion helper and update region formatting.
- Enhanced error handling in the API adapter to standardize error responses.
- Updated tests and type definitions to incorporate new endpoints and region types.
Reviewed Changes
Copilot reviewed 12 out of 12 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
| src/utils/utils.ts | Added a header conversion function and updated region formatting. |
| src/utils/adapter.ts | Refactored error handling with improved error response formation. |
| src/uiLocation.ts | Integrated new endpoints and adjusted region type usage. |
| src/types/api.type.ts | Added a new type definition for Contentstack endpoints. |
| src/types.ts | Updated region definitions and type usage for region-related values. |
| test/* | Updated and added tests to align with the new region and endpoint changes. |
Signed-off-by: Amitkanswal <amitkanswal7@gmail.com>
rijil-tr
approved these changes
Apr 3, 2025
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.
Changes-