[core] Do not mask exceptions for non logged in users

Currently, if there is a server error with an anonymous user using Hue,
a nonsensical "user does not have 'has_permission' method" message and stacktrace
appear. In reality, the real error/problem is hidden. This is because
common header doesn't support anonymous users.