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

Clasp doesn't seem to set errorlevel in windows #1019

Closed
seeker1983 opened this issue Nov 18, 2024 · 2 comments
Closed

Clasp doesn't seem to set errorlevel in windows #1019

seeker1983 opened this issue Nov 18, 2024 · 2 comments

Comments

@seeker1983
Copy link

seeker1983 commented Nov 18, 2024

Simple issue - it seems that the clasp doesn't set error code(%errorlevel% in windows in case of failure)
That's how it looks

d:\gas\internal>clasp push
/ Pushing files…Push failed. Errors:
GaxiosError: Syntax error: SyntaxError: Unexpected identifier 'en' line: 1 file: code.gs
at Gaxios._request (C:\Users\Roman\AppData\Roaming\npm\node_modules@google\clasp\node_modules\gaxios\build\src\gaxios.js:129:23)
at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
at async OAuth2Client.requestAsync (C:\Users\Roman\AppData\Roaming\npm\node_modules@google\clasp\node_modules\google-auth-library\build\src\auth\oauth2client.js:368:18)
at async pushFiles (file:///C:/Users/Roman/AppData/Roaming/npm/node_modules/@google/clasp/build/src/files.js:296:17)
at async Command.default (file:///C:/Users/Roman/AppData/Roaming/npm/node_modules/@google/clasp/build/src/commands/push.js:63:5)
at async Command.parseAsync (C:\Users\Roman\AppData\Roaming\npm\node_modules@google\clasp\node_modules\commander\lib\command.js:923:5)
at async file:///C:/Users/Roman/AppData/Roaming/npm/node_modules/@google/clasp/build/src/index.js:361:9 {
response: {
config: {
url: 'https://script.googleapis.com/v1/projects/18DaHJ_AzDi3FUy_KLgLrn3JlM2_JbZVtNtF2EfYkGULL_Zc5_rCRahb_/content',
method: 'PUT',
userAgentDirectives: [Array],
paramsSerializer: [Function (anonymous)],
data: [Object],
headers: [Object],
params: {},
validateStatus: [Function (anonymous)],
retry: true,
body: '{...}'
errors: [
{
message: "Syntax error: SyntaxError: Unexpected identifier 'en' line: 1 file: code.gs",
domain: 'global',
reason: 'badRequest'
}
]
}
└─ appsscript.json
└─ code.js
Pushed 2 files.

d:\gas\internal>echo %errorlevel%
0

Is it not implemented?

@sqrrrl
Copy link
Member

sqrrrl commented Jan 7, 2025

It is supposed to be setting the error code at

} catch (error) {
, but looks like the error isn't propagated from
stopSpinner();

Easiest fix is to rethrow the error in pushFiles()

@sqrrrl
Copy link
Member

sqrrrl commented Jan 9, 2025

Should be fixed in 2.5.0

@sqrrrl sqrrrl closed this as completed Jan 9, 2025
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