@@ -30,7 +30,6 @@ exports.helloError = (event, context, callback) => {
30
30
// [START functions_helloworld_error]
31
31
// These WILL be reported to Error Reporting
32
32
throw new Error ( 'I failed you' ) ; // Will cause a cold start if not caught
33
-
34
33
// [END functions_helloworld_error]
35
34
} ;
36
35
@@ -42,12 +41,12 @@ exports.helloError = (event, context, callback) => {
42
41
* @param {function } callback The callback function.
43
42
*/
44
43
exports . helloError2 = ( event , context , callback ) => {
45
- // [START functions_helloworld_error ]
44
+ // [START functions_helloworld_error_2 ]
46
45
// These WILL be reported to Error Reporting
47
46
console . error ( new Error ( 'I failed you' ) ) ; // Logging an Error object
48
47
console . error ( 'I failed you' ) ; // Logging something other than an Error object
49
48
throw 1 ; // Throwing something other than an Error object
50
- // [END functions_helloworld_error ]
49
+ // [END functions_helloworld_error_2 ]
51
50
} ;
52
51
53
52
/**
@@ -58,16 +57,16 @@ exports.helloError2 = (event, context, callback) => {
58
57
* @param {function } callback The callback function.
59
58
*/
60
59
exports . helloError3 = ( event , context , callback ) => {
60
+ // [START functions_helloworld_error_3]
61
61
// This will NOT be reported to Error Reporting
62
- // [START functions_helloworld_error]
63
62
callback ( 'I failed you' ) ;
64
- // [END functions_helloworld_error ]
63
+ // [END functions_helloworld_error_3 ]
65
64
} ;
66
65
67
66
// HTTP Cloud Function that returns an error.
68
67
functions . http ( 'helloError4' , ( req , res ) => {
68
+ // [START functions_helloworld_error_4]
69
69
// This will NOT be reported to Error Reporting
70
- // [START functions_helloworld_error]
71
70
res . status ( 500 ) . send ( 'I failed you' ) ;
72
- // [END functions_helloworld_error ]
71
+ // [END functions_helloworld_error_4 ]
73
72
} ) ;
0 commit comments