Skip to content

Commit

Permalink
Exit 1 for all errors
Browse files Browse the repository at this point in the history
  • Loading branch information
ninxsoft committed Jan 25, 2024
1 parent 674caee commit 1112ef3
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 4 deletions.
4 changes: 3 additions & 1 deletion Mist/Commands/Download/DownloadFirmwareCommand.swift
Original file line number Diff line number Diff line change
Expand Up @@ -334,7 +334,7 @@ struct DownloadFirmwareCommand: ParsableCommand {
return url
}

mutating func run() {
mutating func run() throws {
do {
try DownloadFirmwareCommand.run(options: options)
} catch {
Expand All @@ -343,6 +343,8 @@ struct DownloadFirmwareCommand: ParsableCommand {
} else {
PrettyPrint.print(error.localizedDescription, noAnsi: options.noAnsi, prefix: .ending, prefixColor: .red)
}

throw ExitCode(1)
}
}
}
4 changes: 3 additions & 1 deletion Mist/Commands/Download/DownloadInstallerCommand.swift
Original file line number Diff line number Diff line change
Expand Up @@ -584,7 +584,7 @@ struct DownloadInstallerCommand: ParsableCommand {
return url
}

mutating func run() {
mutating func run() throws {
do {
try DownloadInstallerCommand.run(options: options)
} catch {
Expand All @@ -593,6 +593,8 @@ struct DownloadInstallerCommand: ParsableCommand {
} else {
PrettyPrint.print(error.localizedDescription, noAnsi: options.noAnsi, prefix: .ending, prefixColor: .red)
}

throw ExitCode(1)
}
}
}
Expand Down
4 changes: 3 additions & 1 deletion Mist/Commands/List/ListFirmwareCommand.swift
Original file line number Diff line number Diff line change
Expand Up @@ -164,7 +164,7 @@ struct ListFirmwareCommand: ParsableCommand {
}
}

mutating func run() {
mutating func run() throws {
do {
try ListFirmwareCommand.run(options: options)
} catch {
Expand All @@ -173,6 +173,8 @@ struct ListFirmwareCommand: ParsableCommand {
} else {
PrettyPrint.print(error.localizedDescription, noAnsi: options.noAnsi, prefix: .ending, prefixColor: .red)
}

throw ExitCode(1)
}
}
}
4 changes: 3 additions & 1 deletion Mist/Commands/List/ListInstallerCommand.swift
Original file line number Diff line number Diff line change
Expand Up @@ -159,7 +159,7 @@ struct ListInstallerCommand: ParsableCommand {
}
}

mutating func run() {
mutating func run() throws {
do {
try ListInstallerCommand.run(options: options)
} catch {
Expand All @@ -168,6 +168,8 @@ struct ListInstallerCommand: ParsableCommand {
} else {
PrettyPrint.print(error.localizedDescription, noAnsi: options.noAnsi, prefix: .ending, prefixColor: .red)
}

throw ExitCode(1)
}
}
}

0 comments on commit 1112ef3

Please sign in to comment.