Cleanly catch exceptions from sendResponse

Closes #178