-
Notifications
You must be signed in to change notification settings - Fork 438
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
clasp login --creds
emits poor error messages
#526
Comments
Hey @tehhowch thanks for the detailed report! I think the reason you are seeing different behavior in the 3 use cases you described is because they go through the flow of things in somewhat different orders. See:
Line 192 in b6a57db
This tried to read the local Lines 20 to 21 in b6a57db
Lines 26 to 28 in b6a57db
I think (1) and (2) can be grouped together and can be fixed by changing the order in which we make checks (like validating the file first). (3) should be better documented and a new validation should be implemented for these types of auth files. |
This seems to still be an issue? |
Expected Behavior
Passing an incorrect file (any file that (currently) is not an installed app credentials file) to the
--creds
option results in clasp rejecting the file with a meaningful error, such asActual Behavior
Generic error messages are returned, such as
Steps to Reproduce the Problem
.clasp.json
file present, but noappsscript.json
, the manifest error occurs after the message about logging in locally. As above, this should probably fail first for the bad argument:appsscript.json
manifest in the directory, then the situation referred to in this Stack Overflow post occurs:The input file is assumed to be valid credentials by
authorize
:clasp/src/auth.ts
Lines 88 to 98 in dde4fb2
and thus the log step triggers the error and catch branch:
clasp/src/auth.ts
Lines 180 to 182 in dde4fb2
Specifications
node -v
): v8.11.2clasp -v
): 2.0.1If this isn't worth a code fix, I recommend making the expectations regarding the local credential file more obvious in the associated README - right now there is very little description:
Even under the main README's description of
clasp run
, there is no link to the much more helpfuldocs/run.md
which does indicate where this local credential file should come from. (There is a link to it in the README's ToC, but not in the description ofclasp run
)The text was updated successfully, but these errors were encountered: