I like this approach much better. Thanks!
Add support for auth-backend UserQueryErrors
Review Request #5771 — Created May 4, 2014 and submitted
Add support for auth-backend UserQueryErrors.
Extensions with custom AuthBackends can now raise a UserQueryError,
with a detailed message, from within a query_users() method. It will
be caught and turned into a web API USER_QUERRY_ERROR.
All unit tests pass except for some VCS-specific ones, which are skipped.
Manually verified that a UserQueryError with a custom message passed
from an extension gets included in an AJAX error response.