Reconfigure middleware to catch errors correctly.
Merge pull request #103 from sgunturi/fix-prod-error-handling

Reconfigure middleware to catch errors correctly.