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

Improve error message for null option definition #2003

Merged
merged 5 commits into from
Jan 5, 2024

Conversation

t1m0thyj
Copy link
Member

@t1m0thyj t1m0thyj commented Jan 3, 2024

Fixes #2002 and also a typo in help for the zos-workflows create commands (definiton -> definition)

Signed-off-by: Timothy Johnson <timothy.johnson@broadcom.com>
Signed-off-by: Timothy Johnson <timothy.johnson@broadcom.com>
@t1m0thyj t1m0thyj self-assigned this Jan 3, 2024
Copy link

codecov bot commented Jan 3, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Comparison is base (e13f4d5) 91.03% compared to head (7595412) 91.03%.

Additional details and impacted files
@@           Coverage Diff           @@
##           master    #2003   +/-   ##
=======================================
  Coverage   91.03%   91.03%           
=======================================
  Files         636      636           
  Lines       18720    18720           
  Branches     3901     3901           
=======================================
  Hits        17042    17042           
  Misses       1677     1677           
  Partials        1        1           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Signed-off-by: Timothy Johnson <timothy.johnson@broadcom.com>
Copy link
Member

@zFernand0 zFernand0 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM! 😋
Thanks for fixing all the definitons "succesfully" 😋

Before

[2024/01/03 20:37:05.829] [FATAL] [main.js:48] Error initializing Zowe CLI:
 ImperativeError: An option definition is null or undefined.
    at CommandPreparer.performBasicOptionValidation (/root/gh/zowe/zowe-cli/packages/imperative/lib/cmd/src/CommandPreparer.js:290:23)
    ...
    at Imperative.<anonymous> (/root/gh/zowe/zowe-cli/packages/imperative/lib/imperative/src/Imperative.js:238:53)
    at Generator.next (<anonymous>) {
  mDetails: {
    msg: 'An option definition is null or undefined.',
    additionalDetails: 'CURRENT_TREE:\n' +
      '[{"name"... 1592384 more characters 
      *** THIS IS THE ENTIRE COMMAND TREE ***
  },
  mMessage: 'An option definition is null or undefined.'
}

After

[2024/01/03 20:37:05.829] [FATAL] [main.js:48] Error initializing Zowe CLI:
 ImperativeError: An option definition is null or undefined.
    at CommandPreparer.performBasicOptionValidation (/root/gh/zowe/zowe-cli/packages/imperative/lib/cmd/src/CommandPreparer.js:290:23)
    ...
    at Imperative.<anonymous> (/root/gh/zowe/zowe-cli/packages/imperative/lib/imperative/src/Imperative.js:238:53)
    at Generator.next (<anonymous>) {
  mDetails: {
    msg: 'An option definition is null or undefined.',
    additionalDetails: 'COMMAND_DEFINITION:\n' +
      `{"handler":"/root/gh/zowe/zowe-cli/packages/cli/lib/zosfiles/copy/ds/Ds.handler",     
       *** THIS GIVES YOU THE COMMAND HANDLER PATH***
  },
  mMessage: 'An option definition is null or undefined.'
}

@zFernand0
Copy link
Member

zFernand0 commented Jan 3, 2024

Only 2 integration test snapshots missing.
Still LGTM though 😋


Update: Those integration test files are fixed 😋
Thanks @t1m0thyj

Signed-off-by: Timothy Johnson <timothy.johnson@broadcom.com>
Copy link
Contributor

@ATorrise ATorrise left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

thanks timothy!

Signed-off-by: Timothy Johnson <timothy.johnson@broadcom.com>
Copy link

sonarqubecloud bot commented Jan 4, 2024

@t1m0thyj t1m0thyj merged commit dafbce6 into master Jan 5, 2024
19 checks passed
@t1m0thyj t1m0thyj deleted the fix/better-validation-errors branch January 5, 2024 14:10
@t1m0thyj t1m0thyj added the release-current Indicates that there is no new functionality being delivered label Jan 5, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
release-current Indicates that there is no new functionality being delivered
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Error thrown for null option definition doesn't point to bad command
6 participants