Skip to content

Commit

Permalink
better throw exception
Browse files Browse the repository at this point in the history
  • Loading branch information
benjben committed Aug 17, 2021
1 parent 3e17d7c commit abd6c67
Showing 1 changed file with 8 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -112,9 +112,14 @@ object Enrich {
val payload = ThriftLoader.toCollectorPayload(row, processor)
val collectorTstamp = payload.toOption.flatMap(_.flatMap(_.context.timestamp).map(_.getMillis))

System.out.println("Going to crash")
throw new IllegalArgumentException("TEST CRASH")
System.out.println("Crashed")
payload.toOption match {
case Some(Some(p)) =>
p.body match {
case Some(b) if b.contains("crash") => throw new RuntimeException("TEST CRASH")
case _ => System.out.println("foo")
}
case _ => System.out.println("bar")
}

val result =
for {
Expand Down

0 comments on commit abd6c67

Please sign in to comment.