Skip to content

Commit

Permalink
fix: throw command execution exception (#1617)
Browse files Browse the repository at this point in the history
  • Loading branch information
jotoh98 committed Nov 14, 2024
1 parent 17e67dc commit 8e4443f
Showing 1 changed file with 4 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -99,13 +99,15 @@ object DeviceService {
}
}

private fun executeCommands(maestro: Maestro, commands: List<MaestroCommand>): Throwable? {
private fun executeCommands(maestro: Maestro, commands: List<MaestroCommand>) {
var failure: Throwable? = null
val result = Orchestra(maestro, onCommandFailed = { _, _, throwable ->
failure = throwable
Orchestra.ErrorResolution.FAIL
}).executeCommands(commands)
return if (result) null else (failure ?: RuntimeException("Command execution failed"))
if (failure != null) {
throw RuntimeException("Command execution failed")
}
}

private fun treeToElements(tree: TreeNode): List<UIElement> {
Expand Down

0 comments on commit 8e4443f

Please sign in to comment.