You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@pekko.apache.org by "mdedetrich (via GitHub)" <gi...@apache.org> on 2023/10/09 17:23:07 UTC

[PR] Simplify and refactor IncompatibleClassChangeError [incubator-pekko]

mdedetrich opened a new pull request, #702:
URL: https://github.com/apache/incubator-pekko/pull/702

   Simple refactor that makes the code more cleaner/understandable


-- 
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: notifications-unsubscribe@pekko.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@pekko.apache.org
For additional commands, e-mail: notifications-help@pekko.apache.org


Re: [PR] Simplify and refactor IncompatibleClassChangeError [incubator-pekko]

Posted by "He-Pin (via GitHub)" <gi...@apache.org>.
He-Pin commented on code in PR #702:
URL: https://github.com/apache/incubator-pekko/pull/702#discussion_r1350591558


##########
actor/src/main/scala/org/apache/pekko/actor/ActorSystem.scala:
##########
@@ -841,16 +841,16 @@ private[pekko] class ActorSystemImpl(
         cause match {
           case NonFatal(_) | _: InterruptedException | _: NotImplementedError | _: ControlThrowable =>
             log.error(cause, "Uncaught error from thread [{}]", thread.getName)
-          case _ =>
-            if (cause.isInstanceOf[IncompatibleClassChangeError] && cause.getMessage.startsWith("org.apache.pekko"))
-              System.err.println(
-                s"""Detected ${cause.getClass.getName} error, which MAY be caused by incompatible Pekko versions on the classpath.
+          case classChangeError: IncompatibleClassChangeError

Review Comment:
   `incompatibleClassChangeError:IncompatibleClassChangeError`?
   or just `error:IncompatibleClassChangeError`



-- 
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: notifications-unsubscribe@pekko.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@pekko.apache.org
For additional commands, e-mail: notifications-help@pekko.apache.org


Re: [PR] Simplify and refactor IncompatibleClassChangeError [incubator-pekko]

Posted by "mdedetrich (via GitHub)" <gi...@apache.org>.
mdedetrich closed pull request #702: Simplify and refactor IncompatibleClassChangeError
URL: https://github.com/apache/incubator-pekko/pull/702


-- 
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: notifications-unsubscribe@pekko.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@pekko.apache.org
For additional commands, e-mail: notifications-help@pekko.apache.org


Re: [PR] Simplify and refactor IncompatibleClassChangeError [incubator-pekko]

Posted by "mdedetrich (via GitHub)" <gi...@apache.org>.
mdedetrich commented on code in PR #702:
URL: https://github.com/apache/incubator-pekko/pull/702#discussion_r1350604782


##########
actor/src/main/scala/org/apache/pekko/actor/ActorSystem.scala:
##########
@@ -841,16 +841,16 @@ private[pekko] class ActorSystemImpl(
         cause match {
           case NonFatal(_) | _: InterruptedException | _: NotImplementedError | _: ControlThrowable =>
             log.error(cause, "Uncaught error from thread [{}]", thread.getName)
-          case _ =>
-            if (cause.isInstanceOf[IncompatibleClassChangeError] && cause.getMessage.startsWith("org.apache.pekko"))
-              System.err.println(
-                s"""Detected ${cause.getClass.getName} error, which MAY be caused by incompatible Pekko versions on the classpath.
+          case classChangeError: IncompatibleClassChangeError
+              if classChangeError.getMessage.startsWith("org.apache.pekko") =>
+            System.err.println(
+              s"""Detected ${classChangeError.getClass.getName} error, which MAY be caused by incompatible Pekko versions on the classpath.
                   | Please note that a given Pekko version MUST be the same across all modules of Pekko that you are using,
                   | e.g. if you use pekko-actor [${pekko.Version.current} (resolved from current classpath)] all other core
                   | Pekko modules MUST be of the same version. External projects like Connectors, Persistence plugins or Pekko
                   | HTTP etc. have their own version numbers - please make sure you're using a compatible set of libraries.
                  """.stripMargin.replaceAll("[\r\n]", ""))
-
+          case _ =>

Review Comment:
   Thanks for  the pickup, I missed this which explains the previous code. Now that I think of it, I think the PR may be pointless (let me see if I can cleanly solve this).



-- 
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: notifications-unsubscribe@pekko.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@pekko.apache.org
For additional commands, e-mail: notifications-help@pekko.apache.org


Re: [PR] Simplify and refactor IncompatibleClassChangeError [incubator-pekko]

Posted by "mdedetrich (via GitHub)" <gi...@apache.org>.
mdedetrich commented on PR #702:
URL: https://github.com/apache/incubator-pekko/pull/702#issuecomment-1753408697

   Closing PR because I missed this https://github.com/apache/incubator-pekko/pull/702/files#r1350597088


-- 
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: notifications-unsubscribe@pekko.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@pekko.apache.org
For additional commands, e-mail: notifications-help@pekko.apache.org


Re: [PR] Simplify and refactor IncompatibleClassChangeError [incubator-pekko]

Posted by "He-Pin (via GitHub)" <gi...@apache.org>.
He-Pin commented on code in PR #702:
URL: https://github.com/apache/incubator-pekko/pull/702#discussion_r1350597088


##########
actor/src/main/scala/org/apache/pekko/actor/ActorSystem.scala:
##########
@@ -841,16 +841,16 @@ private[pekko] class ActorSystemImpl(
         cause match {
           case NonFatal(_) | _: InterruptedException | _: NotImplementedError | _: ControlThrowable =>
             log.error(cause, "Uncaught error from thread [{}]", thread.getName)
-          case _ =>
-            if (cause.isInstanceOf[IncompatibleClassChangeError] && cause.getMessage.startsWith("org.apache.pekko"))
-              System.err.println(
-                s"""Detected ${cause.getClass.getName} error, which MAY be caused by incompatible Pekko versions on the classpath.
+          case classChangeError: IncompatibleClassChangeError
+              if classChangeError.getMessage.startsWith("org.apache.pekko") =>
+            System.err.println(
+              s"""Detected ${classChangeError.getClass.getName} error, which MAY be caused by incompatible Pekko versions on the classpath.
                   | Please note that a given Pekko version MUST be the same across all modules of Pekko that you are using,
                   | e.g. if you use pekko-actor [${pekko.Version.current} (resolved from current classpath)] all other core
                   | Pekko modules MUST be of the same version. External projects like Connectors, Persistence plugins or Pekko
                   | HTTP etc. have their own version numbers - please make sure you're using a compatible set of libraries.
                  """.stripMargin.replaceAll("[\r\n]", ""))
-
+          case _ =>

Review Comment:
   it will log the `IncompatibleClassChangeError` and exit the jvm, but now only logging when the upper cause match.



-- 
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: notifications-unsubscribe@pekko.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@pekko.apache.org
For additional commands, e-mail: notifications-help@pekko.apache.org