1515
1616'use strict' ;
1717
18- function setupImplicit ( ) {
18+ function setupImplicit ( ) {
1919 // [START error_reporting_setup_implicit]
2020 // Imports the Google Cloud client library
2121 const ErrorReporting = require ( '@google-cloud/error-reporting' ) ;
@@ -28,23 +28,23 @@ function setupImplicit () {
2828 // [END error_reporting_setup_implicit]
2929}
3030
31- function setupExplicit ( ) {
31+ function setupExplicit ( ) {
3232 // [START error_reporting_setup_explicit]
3333 // Imports the Google Cloud client library
3434 const ErrorReporting = require ( '@google-cloud/error-reporting' ) ;
3535
3636 // Instantiates a client
3737 const errors = ErrorReporting ( {
3838 projectId : 'your-project-id' ,
39- keyFilename : '/path/to/key.json'
39+ keyFilename : '/path/to/key.json' ,
4040 } ) ;
4141
4242 // Reports a simple error
4343 errors . report ( 'Something broke!' ) ;
4444 // [END error_reporting_setup_explicit]
4545}
4646
47- function manual ( ) {
47+ function manual ( ) {
4848 // [START error_reporting_manual]
4949 // Imports the Google Cloud client library
5050 const ErrorReporting = require ( '@google-cloud/error-reporting' ) ;
@@ -76,7 +76,7 @@ function manual () {
7676 // [END error_reporting_manual]
7777}
7878
79- function express ( ) {
79+ function express ( ) {
8080 // [START error_reporting_express]
8181 const express = require ( 'express' ) ;
8282
@@ -112,17 +112,43 @@ function express () {
112112// The command-line program
113113const cli = require ( `yargs` )
114114 . demand ( 1 )
115- . command ( 'setup-implicit' , 'Reports a simple error using implicit credentials.' , { } , setupImplicit )
116- . command ( 'setup-explicit' , 'Reports a simple error using explicit credentials.' , { } , setupExplicit )
115+ . command (
116+ 'setup-implicit' ,
117+ 'Reports a simple error using implicit credentials.' ,
118+ { } ,
119+ setupImplicit
120+ )
121+ . command (
122+ 'setup-explicit' ,
123+ 'Reports a simple error using explicit credentials.' ,
124+ { } ,
125+ setupExplicit
126+ )
117127 . command ( 'manual' , 'Manually reports errors.' , { } , manual )
118- . command ( 'express' , 'Starts and Express service with integrated error reporting.' , { } , express )
119- . example ( 'node $0 setup-implicit' , 'Reports a simple error using implicit credentials.' )
120- . example ( 'node $0 setup-explicit' , 'Reports a simple error using explicit credentials.' )
128+ . command (
129+ 'express' ,
130+ 'Starts and Express service with integrated error reporting.' ,
131+ { } ,
132+ express
133+ )
134+ . example (
135+ 'node $0 setup-implicit' ,
136+ 'Reports a simple error using implicit credentials.'
137+ )
138+ . example (
139+ 'node $0 setup-explicit' ,
140+ 'Reports a simple error using explicit credentials.'
141+ )
121142 . example ( 'node $0 manual' , 'Manually report some errors.' )
122- . example ( 'node $0 express' , 'Starts and Express service with integrated error reporting.' )
143+ . example (
144+ 'node $0 express' ,
145+ 'Starts and Express service with integrated error reporting.'
146+ )
123147 . wrap ( 120 )
124148 . recommendCommands ( )
125- . epilogue ( `For more information, see https://cloud.google.com/error-reporting/docs` )
149+ . epilogue (
150+ `For more information, see https://cloud.google.com/error-reporting/docs`
151+ )
126152 . help ( )
127153 . strict ( ) ;
128154
0 commit comments