scwhittle commented on code in PR #37748:
URL: https://github.com/apache/beam/pull/37748#discussion_r2880191237


##########
runners/core-java/src/main/java/org/apache/beam/runners/core/SimpleDoFnRunner.java:
##########
@@ -215,8 +217,10 @@ private void invokeProcessElement(WindowedValue<InputT> 
elem) {
     // This can contain user code. Wrap it in case it throws an exception.
     try {
       invoker.invokeProcessElement(new DoFnProcessContext(elem));
-    } catch (Exception ex) {
-      throw wrapUserCodeException(ex);
+    } catch (OutOfMemoryError oom) {
+      throw oom;
+    } catch (Throwable t) {
+      throw wrapUserCodeException(t);

Review Comment:
   I was making this consistent with start and finish, but I can make them 
consistent by changing it the other way so that just Exceptions are wrapped :)
   
   There is some risk if customer code is throwing Errors that we are changing 
behavior, but that seems like bad practice and they could just add catches 
themselves.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to