fix: improve theme profile import validation error message#309
fix: improve theme profile import validation error message#309Kirtan-pc wants to merge 1 commit into
Conversation
When importing a theme profile, if the filename fails validation (e.g. it contains disallowed characters like brackets or unsupported Unicode), the returned error is now descriptive and actionable. Instead of a generic: 'Invalid profile name: the filename contains reserved or disallowed characters.' It now returns: 'Invalid profile name: The filename contains unsupported characters. Please rename the file using only letters, numbers, spaces, hyphens, underscores, and parentheses (maximum 64 characters).'
|
@Kirtan-pc is attempting to deploy a commit to the Dot_NotSam's projects Team on Vercel. A member of the Team first needs to authorize it. |
|
Important Review skippedAuto reviews are limited based on label configuration. 🏷️ Required labels (at least one) (1)
Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Description
This PR improves the error message shown to the user when importing a theme profile whose filename contains reserved or disallowed characters.
Previously, if a user imported a theme profile with an invalid filename (e.g.
my[profile].json), it would fail silently or surface a generic and unhelpful error message:Failed to import theme: Invalid profile name: the filename contains reserved or disallowed characters..Fixes Issue #281
Changes
main.jsto explicitly state:Invalid profile name: The filename contains unsupported characters. Please rename the file using only letters, numbers, spaces, hyphens, underscores, and parentheses (maximum 64 characters).Testing
.jsonfile to include brackets (e.g.,my[test].json).my[test].json.Failed to import theme: Invalid profile name: The filename contains unsupported characters. Please rename the file using only letters, numbers, spaces, hyphens, underscores, and parentheses (maximum 64 characters).