Skip to content

Instantly share code, notes, and snippets.

@leopic
Created November 5, 2018 23:02
Show Gist options
  • Save leopic/3aba7488473fef6b20905e292fed7124 to your computer and use it in GitHub Desktop.
Save leopic/3aba7488473fef6b20905e292fed7124 to your computer and use it in GitHub Desktop.
enum HttpServiceError: Error {
case uno
case dos
}
struct HttpService {
func call() -> throws {}
}
enum FirmwareServiceError: Error {
case tres
case cuatro
}
struct FirmwareService {
func call() -> throws {
let hs = HttpService()
do {
try hs.call()
}
catch error {
// err, error es HttpService, pero quiero tirar FirmwareServiceError
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment