turboFei commented on code in PR #4144:
URL: https://github.com/apache/kyuubi/pull/4144#discussion_r1082153220


##########
kyuubi-common/src/main/scala/org/apache/kyuubi/Utils.scala:
##########
@@ -135,6 +137,20 @@ object Utils extends Logging {
     f.delete()
   }
 
+  /**
+   * delete file in path with logging
+   * @param filePath path to file for deletion
+   * @param errorMessage message as prefix logging with error exception
+   */
+  def deleteFile(filePath: String, errorMessage: String): Unit = {
+    try {
+      Files.delete(Paths.get(filePath))
+    } catch {
+      case e: Exception =>
+        error(s"$errorMessage: $filePath ", e)

Review Comment:
   I think that you can remove the errorMessage here.
   
   ```
   error(s"Failed to delete file: $file", e)
   ```



-- 
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-unsubscr...@kyuubi.apache.org

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


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscr...@kyuubi.apache.org
For additional commands, e-mail: notifications-h...@kyuubi.apache.org

Reply via email to