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 2025/11/21 07:49:57 UTC
[PR] Improve error handling code [pekko-management]
mdedetrich opened a new pull request, #552:
URL: https://github.com/apache/pekko-management/pull/552
A minor improvement that I noticed when working on https://github.com/apache/pekko-management/pull/546
--
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] Improve error handling code [pekko-management]
Posted by "mdedetrich (via GitHub)" <gi...@apache.org>.
mdedetrich commented on code in PR #552:
URL: https://github.com/apache/pekko-management/pull/552#discussion_r2548959497
##########
lease-kubernetes/src/main/scala/org/apache/pekko/coordination/lease/kubernetes/internal/AbstractKubernetesApiImpl.scala:
##########
@@ -201,16 +201,15 @@ import scala.util.control.NonFatal
protected def readConfigVarFromFilesystem(path: String, name: String): Future[Option[String]] = {
val file = Paths.get(path)
if (Files.exists(file)) {
- try {
- FileIO.fromPath(file)
- .toMat(Sink.fold(ByteString.empty)(_ ++ _))(Keep.right)
- .run()
- .map(bs => Some(bs.utf8String))(ExecutionContext.parasitic)
- } catch {
- case NonFatal(e) =>
- log.error(e, "Error reading {} from {}", name, path)
- Future.successful(None)
- }
+ FileIO.fromPath(file)
Review Comment:
You are right, let me close PR.
--
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] Improve error handling code [pekko-management]
Posted by "He-Pin (via GitHub)" <gi...@apache.org>.
He-Pin commented on code in PR #552:
URL: https://github.com/apache/pekko-management/pull/552#discussion_r2548926079
##########
lease-kubernetes/src/main/scala/org/apache/pekko/coordination/lease/kubernetes/internal/AbstractKubernetesApiImpl.scala:
##########
@@ -201,16 +201,15 @@ import scala.util.control.NonFatal
protected def readConfigVarFromFilesystem(path: String, name: String): Future[Option[String]] = {
val file = Paths.get(path)
if (Files.exists(file)) {
- try {
- FileIO.fromPath(file)
- .toMat(Sink.fold(ByteString.empty)(_ ++ _))(Keep.right)
- .run()
- .map(bs => Some(bs.utf8String))(ExecutionContext.parasitic)
- } catch {
- case NonFatal(e) =>
- log.error(e, "Error reading {} from {}", name, path)
- Future.successful(None)
- }
+ FileIO.fromPath(file)
Review Comment:
If there are some throws in the `FlowIO.fromPath`, then this new change will throw outside.
--
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] Improve error handling code [pekko-management]
Posted by "mdedetrich (via GitHub)" <gi...@apache.org>.
mdedetrich commented on code in PR #552:
URL: https://github.com/apache/pekko-management/pull/552#discussion_r2548945398
##########
lease-kubernetes/src/main/scala/org/apache/pekko/coordination/lease/kubernetes/internal/AbstractKubernetesApiImpl.scala:
##########
@@ -201,16 +201,15 @@ import scala.util.control.NonFatal
protected def readConfigVarFromFilesystem(path: String, name: String): Future[Option[String]] = {
val file = Paths.get(path)
if (Files.exists(file)) {
- try {
- FileIO.fromPath(file)
- .toMat(Sink.fold(ByteString.empty)(_ ++ _))(Keep.right)
- .run()
- .map(bs => Some(bs.utf8String))(ExecutionContext.parasitic)
- } catch {
- case NonFatal(e) =>
- log.error(e, "Error reading {} from {}", name, path)
- Future.successful(None)
- }
+ FileIO.fromPath(file)
Review Comment:
Let me check
--
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] Improve error handling code [pekko-management]
Posted by "mdedetrich (via GitHub)" <gi...@apache.org>.
mdedetrich closed pull request #552: Improve error handling code
URL: https://github.com/apache/pekko-management/pull/552
--
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