SwiftCGI icon indicating copy to clipboard operation
SwiftCGI copied to clipboard

Adopt proper Swift exception handling

Open ianthetechie opened this issue 10 years ago • 1 comments

Swift does not yet support exception handling, but when it does, the main request/response handler block, including all of the wares (pre, middle, and post) should be wrapped in a giant exception handler that returns a 500 response if something goes wrong.

ianthetechie avatar Feb 19 '15 08:02 ianthetechie

Now that the details are in... many usages of fatalError should now be replaced with a swift-style exception and caught in a logical place. fatalError should only be used in cases of programmer error. Otherwise, we generally want our server to be able to recover and continue handling requests.

ianthetechie avatar Jan 11 '16 04:01 ianthetechie