clasp icon indicating copy to clipboard operation
clasp copied to clipboard

Improve output (and suppress GaxiosError) on failed push

Open Nu11u5 opened this issue 3 years ago • 9 comments

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

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

Nu11u5 avatar Jul 02 '21 15:07 Nu11u5

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).

:memo: 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[bot] avatar Jul 02 '21 15:07 google-cla[bot]

@googlebot I signed it!

Nu11u5 avatar Jul 02 '21 17:07 Nu11u5

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.

google-cla[bot] avatar Jul 02 '21 17:07 google-cla[bot]

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] ?

alex-galey avatar Jan 11 '22 18:01 alex-galey

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 avatar Jan 12 '22 01:01 Nu11u5

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 avatar Jan 12 '22 19:01 Nu11u5

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 ?

alex-galey avatar Jan 14 '22 14:01 alex-galey

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.

Nu11u5 avatar Jan 15 '22 01:01 Nu11u5

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

alex-galey avatar Jan 21 '22 19:01 alex-galey

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

alex-galey avatar Mar 20 '23 17:03 alex-galey

@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.

Nu11u5 avatar Mar 21 '23 04:03 Nu11u5

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

alex-galey avatar Aug 22 '23 19:08 alex-galey

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

tecsoc avatar Oct 15 '23 03:10 tecsoc