Changes error500() to use RequestContext

Resolves part of Github Issue #946.
Merge pull request #948 from learning-unlimited/error500-request-context

Changes error500() to use RequestContext