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

A silent failure occurs if a file path listed in filePushOrder does not exist #984

Open
aviflax opened this issue Nov 2, 2023 · 2 comments

Comments

@aviflax
Copy link

aviflax commented Nov 2, 2023

(Note: Non-breaking issues are likely not to be prioritized. Please consider a PR in addition to your issue)

Expected Behavior

If a file path listed in filePushOrder does not exist, I would expect clasp push to fail with a clear error message.

Actual Behavior

It just skips the missing file and continues as if nothing went wrong.

Steps to Reproduce the Problem

  1. Add a path to a non-existing file to filePushOrder
  2. Run clasp push
  3. Observe that the output to stdout and stderr includes no error message about the non-existing file path
  4. Run echo $?
    1. Observe that the exit code of clasp push is 0 but should have been non-zero.

Specifications

  • Node version (node -v): v20.8.1
  • Version (clasp -v): 2.4.2
  • OS (Mac/Linux/Windows): macOS 13.6 22G120
@Nu11u5
Copy link
Contributor

Nu11u5 commented Nov 2, 2023

I think this could be a warning, rather than an error that cancels the push and raises the exit code. If the file is no longer part of the project, that suggests it's not needed anymore.

@aviflax
Copy link
Author

aviflax commented Nov 2, 2023

Could be, sure. But on the other hand, there’s the case of typos. In my case, I was trying to fix an intermittent problem with a program that seemed to be caused by race conditions in code loading. I thought it might help to have a certain file pushed first, before all the rest. So I added this key to the config file and pushed, and… no change.

Weeks later I double checked and realized I had a missing character in the file name, the result of a typo. So my attempted fix had never actually taken effect, and since clasp had (IMO) failed silently, it took me a long time to find out about it.

Personally I prefer tools to fail fast and fail loudly, any time they cannot accomplish exactly what I’ve asked them to do.

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

No branches or pull requests

2 participants