Make res.error() return an object with code and message

This is useful if you're doing something like `throw res.error(code, message)`.