Custom error messages in UI in custom PAMAuthenticator

I am using a custom PAMAuthenticator class (jupyterhub==1.1.0), where I am checking LDAP groups for a user - if certain one is not available I’d like the Authenticator (or Spawner) to fail with a custom message, e.g. You don't have access to JH. At the moment my authenticate method is returning None in such cases, which results in Invalid username or password while authenticating, which does not say what is the problem exactly. What would be the best place to handle such checks (some hooks?) and how I can pass a custom error message to the user?

I can’t check right now, but I think if you raise HTTPError(403, “your message”) it will propagate to the user.