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

Improve output (and suppress GaxiosError) on failed push #857

Merged

Conversation

Nu11u5
Copy link
Contributor

@Nu11u5 Nu11u5 commented Jul 2, 2021

Fixes #827, #907

  • Suppresses GaxiosError object dump on failed push
  • Instead, only error.message is output to the console
  • Always calls stopSpinner() before outputting to console
  • Only shows project file list and success message when no error is thrown
  • Formats syntax error message file path and line number as parsable by IDEs
  • Outputs formatted code snippet of the error line

Checklist

  • npm run test succeeds.
  • npm run lint succeeds.
  • Appropriate changes to README are included in PR.

@google-cla
Copy link

google-cla bot commented Jul 2, 2021

Thanks for your pull request. It looks like this may be your first contribution to a Google open source project (if not, look below for help). Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA).

📝 Please visit https://cla.developers.google.com/ to sign.

Once you've signed (or fixed any issues), please reply here with @googlebot I signed it! and we'll verify it.


What to do if you already signed the CLA

Individual signers
Corporate signers

ℹ️ Googlers: Go here for more info.

@google-cla google-cla bot added the cla: no label Jul 2, 2021
@Nu11u5
Copy link
Contributor Author

Nu11u5 commented Jul 2, 2021

@googlebot I signed it!

@google-cla
Copy link

google-cla bot commented Jul 2, 2021

We found a Contributor License Agreement for you (the sender of this pull request), but were unable to find agreements for all the commit author(s) or Co-authors. If you authored these, maybe you used a different email address in the git commits than was used to sign the CLA (login here to double check)? If these were authored by someone else, then they will need to sign a CLA as well, and confirm that they're okay with these being contributed to Google.
In order to pass this check, please resolve this problem and then comment @googlebot I fixed it.. If the bot doesn't comment, it means it doesn't think anything has changed.

ℹ️ Googlers: Go here for more info.

@alex-galey
Copy link

Is this interesting contribution blocked just because of a failed CLA detection by google bot ?!
@Nu11u5 can you try to sign with your github e-mail address nu***[email protected] ?

@Nu11u5
Copy link
Contributor Author

Nu11u5 commented Jan 12, 2022

Is this interesting contribution blocked just because of a failed CLA detection by google bot ?! @Nu11u5 can you try to sign with your github e-mail address nu***[email protected] ?

I think I submitted my commit wrong, instead of using @users.noreply.github.com, so GitHub can't associate it with my account. Attempting to fix.

@alex-galey - fixed, thanks for pinging me the reminder.

@Nu11u5 Nu11u5 force-pushed the add-GaxiosError-object-suppression branch from 05b32e6 to 81b498a Compare January 12, 2022 03:09
@google-cla google-cla bot added cla: yes and removed cla: no labels Jan 12, 2022
@Nu11u5 Nu11u5 force-pushed the add-GaxiosError-object-suppression branch 2 times, most recently from f1a968b to 0d034da Compare January 12, 2022 19:17
@Nu11u5
Copy link
Contributor Author

Nu11u5 commented Jan 12, 2022

Recommited with merge conflicts properly resolved. Added syntax error output formatting so that file names and line numbers can be parsed by popular IDEs and linked to the source file. Tested in VS Code.

@Nu11u5 Nu11u5 force-pushed the add-GaxiosError-object-suppression branch from 0d034da to 33ab685 Compare January 12, 2022 22:51
@alex-galey
Copy link

Is your PR also aims to solve that behavior of clasp not throwing an error when a Gaxios error happens and concluding with a misleading message "Pushed x files." when it didn't successfully push ?

@Nu11u5
Copy link
Contributor Author

Nu11u5 commented Jan 15, 2022

Is your PR also aims to solve that behavior of clasp not throwing an error when a Gaxios error happens and concluding with a misleading message "Pushed x files." when it didn't successfully push ?

Yes, the success message and file list will now only be output when the push succeeds.

If it fails due to a syntax error detected by GAS, it will return a single line error message that can be automatically linked to the source file/line in an IDE like VS Code.

Any other type of error from GAS will return just the error description instead of dumping everything to the terminal.

@alex-galey
Copy link

@PopGoesTheWza is there a chance this PR is merged or do you see anything else that should be worked on ?

@Nu11u5 Nu11u5 changed the title Suppress GaxiosError object dump on failed push Improve output (and suppress GaxiosError) on failed push Feb 10, 2022
@alex-galey
Copy link

Hi @sqrrrl, is there a chance this PR is merged or do you see anything else that should be worked on ?

@Nu11u5
Copy link
Contributor Author

Nu11u5 commented Mar 21, 2023

@alex-galey thanks for trying to bring attention to this. I had honestly forgotten about this PR. Please share of any additional work should be done.

@alex-galey
Copy link

@sqrrrl do you have any insight why this PR is not being merged ?

@tecsoc
Copy link

tecsoc commented Oct 15, 2023

I need this PR for me too.
Why not merge?

@PopGoesTheWza PopGoesTheWza merged commit 1931c5f into google:master Dec 27, 2023
bmanth60 added a commit to bmanth60/clasp that referenced this pull request May 9, 2024
* Fix typo in README: "They" -> "The" (google#975)

* Add config-files and esmodules to docs/README (google#986)

* Improve output (and suppress GaxiosError) on failed push (google#857)

* fix run.md for Google Workspace user (google#898)

* chore(deps-dev): bump @babel/traverse from 7.14.2 to 7.23.2 (google#982)

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* chore(deps): bump nanoid and mocha (google#977)

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* chore(deps): bump minimatch, recursive-readdir and mocha (google#976)

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* chore(deps-dev): bump word-wrap from 1.2.3 to 1.2.4 (google#970)

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* chore(deps): bump semver from 5.7.1 to 5.7.2 (google#969)

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* chore(deps): bump json-schema and jsprim (google#943)

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* chore(deps): bump node-forge and google-p12-pem (google#941)

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* chore(deps): bump qs from 6.5.2 to 6.5.3 (google#951)

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* chore(deps): bump json5 from 2.2.0 to 2.2.3 (google#954)

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* chore(deps): bump http-cache-semantics from 4.1.0 to 4.1.1 (google#958)

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* [docs] Add clasp run instructions to deploy script as API Executable (google#1004)

* Fix typo (google#1002)

* update install command for `@types/google-apps-script` (google#999)

* rebuild

---------

Co-authored-by: Adam Smith <[email protected]>
Co-authored-by: Ravi van Rooijen <[email protected]>
Co-authored-by: Nu11u5 <[email protected]>
Co-authored-by: Hirokazu Takatama <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Dan Dascalescu <[email protected]>
Co-authored-by: Alejandro Marco <[email protected]>
Co-authored-by: Joseph Mearman <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Suppress GaxiosError object dump
4 participants