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

Fixes unhandled rejection in clasp logs #129

Merged
merged 1 commit into from Apr 23, 2018
Merged

Fixes unhandled rejection in clasp logs #129

merged 1 commit into from Apr 23, 2018

Conversation

campionfellin
Copy link
Collaborator

@campionfellin campionfellin commented Apr 22, 2018

Does this by catching the error and logging an appropriate message for the user.

The error that it catches looks like:

{ Error: 8 RESOURCE_EXHAUSTED: Insufficient tokens for quota 'logging.googleapis.com/read_requests' and limit 'ReadRequestsPerMinutePerUser' of s
ervice 'logging.googleapis.com' for consumer 'project_number:xxxxxxxx'.
    at new createStatusError (/Users/campionfellin/Desktop/gcp-work/clasp/node_modules/grpc/src/client.js:64:15)
    at /Users/campionfellin/Desktop/gcp-work/clasp/node_modules/grpc/src/client.js:583:15
  code: 8,
  metadata:
   Metadata {
     _internal_repr:
      { 'google.rpc.help-bin': [Array],

My guess is that this error comes about because StackDriver logging takes a few minutes to get all set up. This PR catches that error and tells the user to try again.

I also noticed another severity level of NOTICE and so added that as well.

Signed-off-by: campionfellin campionfellin@gmail.com

Closes #128

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

Does this by catching the error and loggin an appropriate message for the user.

Signed-off-by: campionfellin <campionfellin@gmail.com>
@coveralls
Copy link

coveralls commented Apr 22, 2018

Pull Request Test Coverage Report for Build 88

  • 0 of 0 (NaN%) changed or added relevant lines in 0 files are covered.
  • 166 unchanged lines in 1 file lost coverage.
  • Overall coverage decreased (-0.01%) to 10.549%

Files with Coverage Reduction New Missed Lines %
index.js 166 7.93%
Totals Coverage Status
Change from base Build 86: -0.01%
Covered Lines: 93
Relevant Lines: 659

💛 - Coveralls

@@ -1071,9 +1072,10 @@ commander
let coloredSeverity = ({
ERROR: chalk.red(severity),
INFO: chalk.blue(severity),
DEBUG: chalk.yellow(severity)
DEBUG: chalk.yellow(severity),
NOTICE: chalk.magenta(severity)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

(We should add trailing-comma to our tslint to prevent 2 line diffs.)

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Noted, will put that in the next PR.

@grant grant merged commit 5fd6aa2 into google:master Apr 23, 2018
@campionfellin campionfellin deleted the fix-logs branch April 23, 2018 02:01
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.

None yet

4 participants