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

office-addin-manifest returns success on non-existent manifest file path #856

Open
tobz1000 opened this issue Apr 22, 2024 · 3 comments
Open

Comments

@tobz1000
Copy link

tobz1000 commented Apr 22, 2024

Expected behavior

office-addin-manifest should return an error code when the specified manifest filepath is non-existent.

Current behavior

The tools returns a success code.

Steps to Reproduce

  1. Run office-addin-manifest validate not-a-dir/manifest.xml
  2. ENOENT error is printed, but the command's return code is 0.

Context

It looks like this issue has been previously raised and fixed (#372), so this may be a regression. EDIT: looks like that PR prints the appropriate error message, but doesn't change the exit code.

  • Operating System: Debian 11
  • Node version: 20.12.0
  • Office version:
  • Tool version: 1.13.0

Failure Logs

$ npx office-addin-manifest validate not-a-dir/manifest.xml; echo $?
Error: Unable to read data for manifest file: not-a-dir/manifest.xml.
Error: ENOENT: no such file or directory, open 'not-a-dir/manifest.xml'
0
@ndeleuze
Copy link
Contributor

@tobz1000 it is most likely that when we catch an error, we are just outputting the message and then gracefully completing rather than returning an error code. What is your scenario where you need the specific error code even when the output displays the error?

@tobz1000
Copy link
Author

tobz1000 commented May 1, 2024

Since the command is for validating the manifest file, it would make sense to return an error if the file can't be found at all. I use the command in a linting script for my codebase. If the manifest filepath is incorrect, the script returns success, suggesting no errors; but it should fail, as the manifest possibly doesn't even exist.

@ndeleuze
Copy link
Contributor

ndeleuze commented May 2, 2024

Thanks for reporting this issue regarding office-addin-manifest validate script not returning the proper error code for this case. It has been put on our backlog. We unfortunately have no timelines to share at this point. However, I would suggest as a workaround that you validate the existence of the manifest before using the office-addin-manifest validate script.

Internal tracking id: Office: 8958771

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

No branches or pull requests

2 participants