File tree Expand file tree Collapse file tree 2 files changed +8
-2
lines changed
sample-apps/error-processor Expand file tree Collapse file tree 2 files changed +8
-2
lines changed Original file line number Diff line number Diff line change 11{
2- "max-depth" : 10 ,
2+ "max-depth" : 50 ,
33 "current-depth" : 0 ,
44 "error-rate" : 0.05
55}
Original file line number Diff line number Diff line change @@ -23,7 +23,6 @@ var myFunction = async function(event, context) {
2323 subsegment . addAnnotation ( 'roll2' , roll2 )
2424 subsegment . addAnnotation ( 'request_id' , context . awsRequestId )
2525 } )
26-
2726
2827 event [ "current-depth" ] += 1
2928 if ( event [ "max-depth" ] == event [ "current-depth" ] ) {
@@ -47,6 +46,13 @@ var myFunction = async function(event, context) {
4746 else {
4847 response . depth += 1
4948 }
49+ if ( response . errorType == "function.MaxDepthError" ) {
50+ var error = new Error ( response . errorMessage )
51+ error . name = "function.MaxDepthError"
52+ console . log ( "ERROR" )
53+ throw error
54+ }
55+
5056 return response
5157}
5258
You can’t perform that action at this time.
0 commit comments