Strengthened middleware to gracefully handle errors
Merge pull request #577 from rwz/3-2-stable

Strengthened middleware to gracefully handle errors