Fix unguess post watcher body#485
Merged
Merged
Conversation
…ging format in PostDossiers
Tests difference: |
Collaborator
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.
This pull request primarily improves error handling and data validation in the
Unguessclass and thePostDossiersroute. The main changes include providing more detailed error information for failed API calls, ensuring robust parsing of error responses, and validating user IDs before returning them. These updates help with debugging and prevent invalid data from propagating through the system.Improved error handling in API requests
Unguess.tsfor authentication and POST requests: now, when a request fails, the thrown error includes the HTTP status, status text, and a parsed error body (if available), making debugging easier. [1] [2]Data validation and robustness
PostDossiersroute, user IDs returned fromretrieveProjectAndWorkspaceUsersare now filtered to ensure they are positive integers, preventing invalid IDs from being included. If no valid IDs are found, the function returnsundefined.retrieveProjectAndWorkspaceUserswas updated to use a direct string reference forcustomer_id, improving query clarity and correctness.Minor improvements
AxiosErrorimport inindex.tsfor potential future error handling enhancements.