@@ -24,8 +24,12 @@ function setupImplicit() {
24
24
// On Node 6+ the following syntax can be used instead:
25
25
// const {ErrorReporting} = require('@google-cloud/error-reporting');
26
26
27
+ // With ES6 style imports via TypeScript or Babel, the following
28
+ // syntax can be used instead:
29
+ // import {ErrorReporting} from '@google-cloud/error-reporting';
30
+
27
31
// Instantiates a client
28
- const errors = ErrorReporting ( ) ;
32
+ const errors = new ErrorReporting ( ) ;
29
33
30
34
// Reports a simple error
31
35
errors . report ( 'Something broke!' ) ;
@@ -41,8 +45,12 @@ function setupExplicit() {
41
45
// On Node 6+ the following syntax can be used instead:
42
46
// const {ErrorReporting} = require('@google-cloud/error-reporting');
43
47
48
+ // With ES6 style imports via TypeScript or Babel, the following
49
+ // syntax can be used instead:
50
+ // import {ErrorReporting} from '@google-cloud/error-reporting';
51
+
44
52
// Instantiates a client
45
- const errors = ErrorReporting ( {
53
+ const errors = new ErrorReporting ( {
46
54
projectId : 'your-project-id' ,
47
55
keyFilename : '/path/to/key.json' ,
48
56
} ) ;
@@ -61,8 +69,12 @@ function manual() {
61
69
// On Node 6+ the following syntax can be used instead:
62
70
// const {ErrorReporting} = require('@google-cloud/error-reporting');
63
71
72
+ // With ES6 style imports via TypeScript or Babel, the following
73
+ // syntax can be used instead:
74
+ // import {ErrorReporting} from '@google-cloud/error-reporting';
75
+
64
76
// Instantiates a client
65
- const errors = ErrorReporting ( ) ;
77
+ const errors = new ErrorReporting ( ) ;
66
78
67
79
// Use the error message builder to customize all fields ...
68
80
const errorEvent = errors . event ( ) ;
@@ -99,8 +111,12 @@ function express() {
99
111
// On Node 6+ the following syntax can be used instead:
100
112
// const {ErrorReporting} = require('@google-cloud/error-reporting');
101
113
114
+ // With ES6 style imports via TypeScript or Babel, the following
115
+ // syntax can be used instead:
116
+ // import {ErrorReporting} from '@google-cloud/error-reporting';
117
+
102
118
// Instantiates a client
103
- const errors = ErrorReporting ( ) ;
119
+ const errors = new ErrorReporting ( ) ;
104
120
105
121
const app = express ( ) ;
106
122
0 commit comments