Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix AggregateException #426

Merged
merged 1 commit into from
Mar 29, 2024
Merged

Conversation

pawelprazak
Copy link
Collaborator

@pawelprazak pawelprazak commented Mar 29, 2024

  • preserve cause and all other causes

Example:

val errors = NonEmptyVector(
      DecodingError("error1", label = Label.fromNameAndType("dummy1", "dummy:pkg:Dummy1"), cause = Exception("cause1")),
      DecodingError("error2", label = Label.fromNameAndType("dummy2", "dummy:pkg:Dummy1")),
      DecodingError("error3", label = Label.fromNameAndType("dummy3", "dummy:pkg:Dummy1"))
    )
    val aggregated = AggregatedDecodingError(errors)
besom.internal.AggregatedDecodingError: Decoding Errors [3]:
  error1
  error2
  error3
(with aggregate stack trace)
	at besom.internal.AggregatedDecodingError$.apply(codecs.scala:100)
	at besom.internal.InternalTest.$init$$$anonfun$34(EncoderTest.scala:996)
	at munit.internal.console.StackTraces$.dropOutside(StackTraces.scala:12)
	...
	at munit.internal.junitinterface.JUnitTask.execute(JUnitTask.java:87)
	at scala.build.testrunner.TestRunner$.runTasks(TestRunner.scala:70)
	at scala.build.testrunner.DynamicTestRunner$.main(DynamicTestRunner.scala:260)
	at scala.build.testrunner.DynamicTestRunner.main(DynamicTestRunner.scala)
Caused by: besom.internal.DecodingError: [dummy1[dummy:pkg:Dummy1]] error1
	at besom.internal.DecodingError$.apply(codecs.scala:80)
	at besom.internal.InternalTest.$init$$$anonfun$34(EncoderTest.scala:992)
	... 53 more
	Suppressed: besom.internal.DecodingError: [dummy2[dummy:pkg:Dummy1]] error2
		at besom.internal.DecodingError$.apply(codecs.scala:81)
		at besom.internal.InternalTest.$init$$$anonfun$34(EncoderTest.scala:993)
		... 53 more
	Suppressed: besom.internal.DecodingError: [dummy3[dummy:pkg:Dummy1]] error3
		at besom.internal.DecodingError$.apply(codecs.scala:81)
		at besom.internal.InternalTest.$init$$$anonfun$34(EncoderTest.scala:994)
		... 53 more
Caused by: java.lang.Exception: cause1
	... 54 more

@pawelprazak pawelprazak added kind/bug Some behavior is incorrect or out of spec area/core The SDK's core code size/S Estimated effort to complete (1-2 days). kind/internal Work that is not visible to an external user impact/no-changelog-required This issue doesn't require a CHANGELOG update labels Mar 29, 2024
@pawelprazak pawelprazak added this to the 0.3.0 milestone Mar 29, 2024
@pawelprazak pawelprazak requested a review from lbialy March 29, 2024 14:31
@pawelprazak pawelprazak force-pushed the pprazak/fix-aggregated-exception branch 4 times, most recently from 51fdaf7 to 5ad2a19 Compare March 29, 2024 15:23
- preserve cause and all other causes
- use proper contract
@pawelprazak pawelprazak force-pushed the pprazak/fix-aggregated-exception branch from 5ad2a19 to 1ef1d70 Compare March 29, 2024 16:10
@pawelprazak pawelprazak merged commit efb248f into main Mar 29, 2024
2 checks passed
@pawelprazak pawelprazak deleted the pprazak/fix-aggregated-exception branch March 29, 2024 17:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/core The SDK's core code impact/no-changelog-required This issue doesn't require a CHANGELOG update kind/bug Some behavior is incorrect or out of spec kind/internal Work that is not visible to an external user size/S Estimated effort to complete (1-2 days).
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants