-
Notifications
You must be signed in to change notification settings - Fork 437
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
Suppress GaxiosError object dump #827
Labels
Comments
As a workaround, stderr can be redirected to null, but this also hides the general error information. Windows: |
Example error (anonymized)Split to allow syntax highlighting
{
response: {
config: {
url: '...',
method: 'PUT',
paramsSerializer: [Function],
data: [Object],
headers: [Object],
params: [Object: null prototype] {},
validateStatus: [Function],
retry: true,
body: '{...}', //// Multiline text including the appsscript file content, very long ////
responseType: 'json',
retryConfig: [Object]
},
data: { error: [Object] },
headers: {
'alt-svc': '...',
'cache-control': 'private',
connection: 'close',
'content-encoding': 'gzip',
'content-type': 'application/json; charset=UTF-8',
date: 'Thu, 04 Feb 2021 21:23:57 GMT',
server: 'ESF',
'transfer-encoding': 'chunked',
vary: 'Origin, X-Origin, Referer',
'x-content-type-options': 'nosniff',
'x-frame-options': 'SAMEORIGIN',
'x-xss-protection': '0'
},
status: 400,
statusText: 'Bad Request',
request: {
responseURL: 'https://script.googleapis.com/v1/projects/...'
}
},
config: {
url: 'https://script.googleapis.com/v1/projects/...',
method: 'PUT',
paramsSerializer: [Function],
data: {
scriptId: '...',
files: [Array]
},
headers: {
'x-goog-api-client': 'gdcl/3.2.0 gl-node/12.16.3 auth/5.7.0',
'Accept-Encoding': 'gzip',
'User-Agent': 'google-api-nodejs-client/3.2.0 (gzip)',
Authorization: 'Bearer ...', //// OAuth bearer token is leaked here ////
'Content-Type': 'application/json',
Accept: 'application/json'
},
params: [Object: null prototype] {},
validateStatus: [Function],
retry: true,
body: '{...}', //// Multiline text including the appsscript file content, very long ////
responseType: 'json',
retryConfig: {
currentRetryAttempt: 0,
retry: 3,
retryDelay: 100,
httpMethodsToRetry: [Array],
noResponseRetries: 2,
statusCodesToRetry: [Array]
}
},
code: 400,
errors: [
{
message: 'Syntax error: SyntaxError: ...',
domain: 'global',
reason: 'badRequest'
}
]
} |
@Nu11u5 Just to be sure the issue still exist, can you try replacing npm uninstall -g @google/clasp
npm install -g forked-clasp |
3 tasks
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Details
When
clasp push
is run with project files containing invalid syntax, a stack trace is output to stderr. The stack trace contains the full error object including the HTTP request and response objects, headers, authorization tokens, and the appsscript file content itself (which can be quite lengthy). This is extremely verbose, leaks credentials to the terminal, and causes performance issues in some terminals (such as the VSCode terminal).Proposed Behavior
If clasp receives an error, it only outputs the general error message information. If verbose error information is needed, an additional command parameter could be used to output the stack trace and full error object to stderr.
Specifications
The text was updated successfully, but these errors were encountered: