Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove forced unwrapped optional try(s) #95

Merged
merged 1 commit into from
Sep 24, 2018

Conversation

nethraravindran
Copy link
Contributor

@nethraravindran nethraravindran commented Sep 18, 2018

The motive is to remove forced unwrapped optional try methods and replace with do-try-catch to avoid crash

do {
try serverChannel.close().wait()
} catch let error {
Log.error("Error: \(error)")
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we have a more detailed error, something like Failed to close the server channel. Error: \(error)

@nethraravindran nethraravindran force-pushed the remove-IUO-Try branch 4 times, most recently from 54233b7 to f452a61 Compare September 21, 2018 07:27
clientChannel.write(NIOAny(HTTPClientRequestPart.head(request)), promise: nil)
_ = clientChannel.write(NIOAny(HTTPClientRequestPart.end(nil)))
do {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We're already in a do block here. I guess you don't need this one.

@pushkarnk pushkarnk merged commit c815224 into Kitura:master Sep 24, 2018
@nethraravindran nethraravindran changed the title Remove forced uwrapped optional try(s) Remove forced unwrapped optional try(s) Dec 24, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants