Error controller to handle HTTP errors.

Fixes #257 and #310.
Don't `===` compare against `1`. `1` is truthy and can be used directly in an `if` condition. But if you prefer, modify `getRESTMethodIdempotence` to return `true` or `false` instead.