Skip to content

Commit

Permalink
feat(ShireRunner): enhance error handling for detachProcess
Browse files Browse the repository at this point in the history
Improve ShireRunner's robustness by wrapping detachProcess call in a try-catch block to handle exceptions gracefully.
  • Loading branch information
phodal committed Jul 22, 2024
1 parent fd45775 commit d221082
Showing 1 changed file with 6 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ class ShireRunner(
private val console: ShireConsoleView,
private val configuration: ShireConfiguration,
private val userInput: String,
private val processHandler: ShireProcessHandler
private val processHandler: ShireProcessHandler,
) {
private var compiledVariables: Map<String, Any> = mapOf()
private val terminalLocationExecutor = TerminalLocationExecutor.provide(project)
Expand Down Expand Up @@ -192,7 +192,11 @@ class ShireRunner(
} catch (e: Exception) {
console.print(e.message ?: "Error", ConsoleViewContentType.ERROR_OUTPUT)
} finally {
processHandler.detachProcess()
try {
processHandler.detachProcess()
} catch (e: Exception) {
// ignored
}
}
}

Expand Down

0 comments on commit d221082

Please sign in to comment.