node-google-apps-script
node-google-apps-script copied to clipboard
Obscure error when authenticated with an account that doesn't have permission on the Script project
When authenticated with an account that doesn't have write permission on the target script project, the output to npm run upload is the following :
Pushing back up to Google Drive...
Error parsing project files
Script file ID not found. Please input an ID and try again.
Upload failed.
This error message seems misleading, because the id of the project is correct! What's wrong is that I'm authenticated with the wrong account.
A potential "fix" (improvement) could be:
- detecting if the problem has occured when reading the Script file ID, or when trying to push to Google Drive;
- if the latter, change the message with something along the lines of "Could not push to the project whose Script file id was specified. Make sure the project exists, and that you have write permissions on it".
I might try to look into it later, but for now I'm leaving this issue for searchable reference if other people run into it.