@@ -21,7 +21,7 @@ describe('applyAggregateErrorsToEvent()', () => {
2121 test ( 'should not do anything if event does not contain an exception' , ( ) => {
2222 const event : Event = { exception : undefined } ;
2323 const eventHint : EventHint = { originalException : new Error ( ) } ;
24- applyAggregateErrorsToEvent ( exceptionFromError , stackParser , undefined , 'cause' , 100 , event , eventHint ) ;
24+ applyAggregateErrorsToEvent ( exceptionFromError , stackParser , 'cause' , 100 , event , eventHint ) ;
2525
2626 // no changes
2727 expect ( event ) . toStrictEqual ( { exception : undefined } ) ;
@@ -30,15 +30,15 @@ describe('applyAggregateErrorsToEvent()', () => {
3030 test ( 'should not do anything if event does not contain exception values' , ( ) => {
3131 const event : Event = { exception : { values : undefined } } ;
3232 const eventHint : EventHint = { originalException : new Error ( ) } ;
33- applyAggregateErrorsToEvent ( exceptionFromError , stackParser , undefined , 'cause' , 100 , event , eventHint ) ;
33+ applyAggregateErrorsToEvent ( exceptionFromError , stackParser , 'cause' , 100 , event , eventHint ) ;
3434
3535 // no changes
3636 expect ( event ) . toStrictEqual ( { exception : { values : undefined } } ) ;
3737 } ) ;
3838
3939 test ( 'should not do anything if event does not contain an event hint' , ( ) => {
4040 const event : Event = { exception : { values : [ ] } } ;
41- applyAggregateErrorsToEvent ( exceptionFromError , stackParser , undefined , 'cause' , 100 , event , undefined ) ;
41+ applyAggregateErrorsToEvent ( exceptionFromError , stackParser , 'cause' , 100 , event , undefined ) ;
4242
4343 // no changes
4444 expect ( event ) . toStrictEqual ( { exception : { values : [ ] } } ) ;
@@ -47,7 +47,7 @@ describe('applyAggregateErrorsToEvent()', () => {
4747 test ( 'should not do anything if the event hint does not contain an original exception' , ( ) => {
4848 const event : Event = { exception : { values : [ ] } } ;
4949 const eventHint : EventHint = { originalException : undefined } ;
50- applyAggregateErrorsToEvent ( exceptionFromError , stackParser , undefined , 'cause' , 100 , event , eventHint ) ;
50+ applyAggregateErrorsToEvent ( exceptionFromError , stackParser , 'cause' , 100 , event , eventHint ) ;
5151
5252 // no changes
5353 expect ( event ) . toStrictEqual ( { exception : { values : [ ] } } ) ;
@@ -62,7 +62,7 @@ describe('applyAggregateErrorsToEvent()', () => {
6262 const event : Event = { exception : { values : [ exceptionFromError ( stackParser , originalException ) ] } } ;
6363 const eventHint : EventHint = { originalException } ;
6464
65- applyAggregateErrorsToEvent ( exceptionFromError , stackParser , undefined , key , 100 , event , eventHint ) ;
65+ applyAggregateErrorsToEvent ( exceptionFromError , stackParser , key , 100 , event , eventHint ) ;
6666 expect ( event ) . toStrictEqual ( {
6767 exception : {
6868 values : [
@@ -108,7 +108,7 @@ describe('applyAggregateErrorsToEvent()', () => {
108108 const event : Event = { exception : { values : [ exceptionFromError ( stackParser , originalException ) ] } } ;
109109 const eventHint : EventHint = { originalException } ;
110110
111- applyAggregateErrorsToEvent ( exceptionFromError , stackParser , undefined , 'cause' , 100 , event , eventHint ) ;
111+ applyAggregateErrorsToEvent ( exceptionFromError , stackParser , 'cause' , 100 , event , eventHint ) ;
112112
113113 // no changes
114114 expect ( event ) . toStrictEqual ( { exception : { values : [ exceptionFromError ( stackParser , originalException ) ] } } ) ;
@@ -127,7 +127,7 @@ describe('applyAggregateErrorsToEvent()', () => {
127127 }
128128
129129 const eventHint : EventHint = { originalException } ;
130- applyAggregateErrorsToEvent ( exceptionFromError , stackParser , undefined , key , 5 , event , eventHint ) ;
130+ applyAggregateErrorsToEvent ( exceptionFromError , stackParser , key , 5 , event , eventHint ) ;
131131
132132 // 6 -> one for original exception + 5 linked
133133 expect ( event . exception ?. values ) . toHaveLength ( 5 + 1 ) ;
@@ -153,7 +153,7 @@ describe('applyAggregateErrorsToEvent()', () => {
153153 const event : Event = { exception : { values : [ exceptionFromError ( stackParser , fakeAggregateError ) ] } } ;
154154 const eventHint : EventHint = { originalException : fakeAggregateError } ;
155155
156- applyAggregateErrorsToEvent ( exceptionFromError , stackParser , undefined , 'cause' , 100 , event , eventHint ) ;
156+ applyAggregateErrorsToEvent ( exceptionFromError , stackParser , 'cause' , 100 , event , eventHint ) ;
157157 expect ( event . exception ?. values ?. [ event . exception . values . length - 1 ] ?. mechanism ?. type ) . toBe ( 'instrument' ) ;
158158 } ) ;
159159
@@ -170,7 +170,7 @@ describe('applyAggregateErrorsToEvent()', () => {
170170 const event : Event = { exception : { values : [ exceptionFromError ( stackParser , fakeAggregateError1 ) ] } } ;
171171 const eventHint : EventHint = { originalException : fakeAggregateError1 } ;
172172
173- applyAggregateErrorsToEvent ( exceptionFromError , stackParser , undefined , 'cause' , 100 , event , eventHint ) ;
173+ applyAggregateErrorsToEvent ( exceptionFromError , stackParser , 'cause' , 100 , event , eventHint ) ;
174174 expect ( event ) . toStrictEqual ( {
175175 exception : {
176176 values : [
@@ -254,7 +254,7 @@ describe('applyAggregateErrorsToEvent()', () => {
254254 const event : Event = { exception : { values : [ exceptionFromError ( stackParser , originalException ) ] } } ;
255255 const eventHint : EventHint = { originalException } ;
256256
257- applyAggregateErrorsToEvent ( exceptionFromError , stackParser , undefined , key , 100 , event , eventHint ) ;
257+ applyAggregateErrorsToEvent ( exceptionFromError , stackParser , key , 100 , event , eventHint ) ;
258258 expect ( event ) . toStrictEqual ( {
259259 exception : {
260260 values : [
@@ -293,53 +293,4 @@ describe('applyAggregateErrorsToEvent()', () => {
293293 } ,
294294 } ) ;
295295 } ) ;
296-
297- test ( 'should truncate the exception values if they exceed the `maxValueLength` option' , ( ) => {
298- const originalException : ExtendedError = new Error ( 'Root Error with long message' ) ;
299- originalException . cause = new Error ( 'Nested Error 1 with longer message' ) ;
300- originalException . cause . cause = new Error ( 'Nested Error 2 with longer message with longer message' ) ;
301-
302- const event : Event = { exception : { values : [ exceptionFromError ( stackParser , originalException ) ] } } ;
303- const eventHint : EventHint = { originalException } ;
304-
305- const maxValueLength = 15 ;
306- applyAggregateErrorsToEvent ( exceptionFromError , stackParser , maxValueLength , 'cause' , 10 , event , eventHint ) ;
307- expect ( event ) . toStrictEqual ( {
308- exception : {
309- values : [
310- {
311- type : 'Error' ,
312- value : 'Nested Error 2 ...' ,
313- mechanism : {
314- exception_id : 2 ,
315- handled : true ,
316- parent_id : 1 ,
317- source : 'cause' ,
318- type : 'chained' ,
319- } ,
320- } ,
321- {
322- type : 'Error' ,
323- value : 'Nested Error 1 ...' ,
324- mechanism : {
325- exception_id : 1 ,
326- handled : true ,
327- parent_id : 0 ,
328- source : 'cause' ,
329- type : 'chained' ,
330- } ,
331- } ,
332- {
333- type : 'Error' ,
334- value : 'Root Error with...' ,
335- mechanism : {
336- exception_id : 0 ,
337- handled : true ,
338- type : 'instrument' ,
339- } ,
340- } ,
341- ] ,
342- } ,
343- } ) ;
344- } ) ;
345296} ) ;
0 commit comments