Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Enhance validateMethod to Include File Paths in Duplicate Command Errors #4324

Open
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

STAR-173
Copy link

@STAR-173 STAR-173 commented Dec 8, 2024

Fixes #4313

Summary:

This PR modifies the validateMethod function in the _command-loader.js file to enhance error messages by displaying the file paths of both the original and conflicting command definitions when a duplicate command is detected. This change makes it easier to debug and track the source of duplicate commands.

Example Error Message:

When a duplicate command is found, the error message will now look like this:

Error while loading the API commands: the command testNamespace.testCommand() is already defined.
- First defined in: /path/to/firstFile.js
- Current file: /path/to/secondFile.js

@CLAassistant
Copy link

CLAassistant commented Dec 8, 2024

CLA assistant check
All committers have signed the CLA.

Copy link

github-actions bot commented Dec 8, 2024

Status

  • ❌ No modified files found in the types directory.
    Please make sure to include types for any changes you have made. Thank you!.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Display the file paths in the error message for the error "the command .myCommand() is already defined."
2 participants