fix: clarify policy deletion error when pending requests exist#1906
Open
krisxcrash wants to merge 3 commits into
Open
fix: clarify policy deletion error when pending requests exist#1906krisxcrash wants to merge 3 commits into
krisxcrash wants to merge 3 commits into
Conversation
The raw API error about pending/approved time off requests was confusing. Now catches the 422 and provides a clear, actionable message explaining what needs to be done before the policy can be deleted.
Fresh Eyes ReviewFound 2 issues in this PR. PR Description Issues
Info (1)
Download findings.json — drag the file into Claude or use Please 👍🏽 👎🏽 if you found this useful. Generated by Fresh Eyes Reviewer. Get help in #ai-code-reviews |
Comment on lines
+163
to
+165
| throw new SDKInternalError(messages.join('. ') || t('errors.deleteFailed'), 'api_error') | ||
| } | ||
| throw err |
There was a problem hiding this comment.
🟡 Minor | [fresh_eyes]: test-coverage
New code path untested: when a 422 error does NOT contain 'pending'/'approved' keywords, the code concatenates error messages or falls back to t('errors.deleteFailed'). No test covers this branch.
Please 👍🏽 👎🏽 if you found this useful. Generated by Fresh Eyes Reviewer. Get help in #ai-code-reviews
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.
Summary
Fixes bug: unclear "there are pending or approved time off requests" error on policy deletion.
Test plan
PolicyList.test.tsxpasses (26/26)