Skip to content

Commit

Permalink
Fix superfluous try/catch causing build error (#187)
Browse files Browse the repository at this point in the history
  • Loading branch information
tristanlabelle authored Oct 22, 2024
1 parent ddda9d0 commit 6891933
Showing 1 changed file with 5 additions and 6 deletions.
11 changes: 5 additions & 6 deletions swiftwinrt/Resources/Support/Error.swift
Original file line number Diff line number Diff line change
Expand Up @@ -180,12 +180,11 @@ public func failWith(error: Swift.Error) -> HRESULT {
hresult = winrtError.hr
}

do {
try message.withHStringRef {
_ = RoOriginateLanguageException(hresult, $0, nil)
}
} catch {
_ = RoOriginateLanguageException(hresult, nil, nil)
message.withHStringRef {
// Returns false if the string is empty or hresult is success,
// in which case there isn't more info to associate with the
// returned hresult.
_ = RoOriginateLanguageException(hresult, $0, nil)
}

return hresult
Expand Down

0 comments on commit 6891933

Please sign in to comment.