Message Resolution Error on Invalid Credentials

Cantor, Scott cantor.2 at osu.edu
Wed Jul 23 13:57:12 EDT 2014


On 7/23/14, 1:25 PM, "Marvin Addison" <marvin.addison at gmail.com> wrote:

>Best I can tell, this is caused by the null error message of the
>thrown LoginException. The MessageChecker has what looks to be invalid
>constraint logic that ought to provide a more helpful error message
>than NPE:

It would need to just eliminate the constraint or we need to check the
null before calling that, I guess. No, I wasn't aware LoginExceptions
would contain no message, but I don't think we want to absolutely require
a message regardless. That's not just used by JAAS anyway.

>That doesn't look right; I believe it should be the following:
>
>Constraint.isFalse(Strings.isNullOrEmpty(msg), "Message cannot be null
>or empty");

We're treating constraints as explicit, so if they fire, it's a bug,
either in the constraint itself or the caller.

>That wouldn't prevent the spurious error afaict, but it would provide
>more helpful diagnostics.

It might be the case that we could use better constraints, I don't know.

>If you agree this is a bug and my analysis is correct, I'm happy to
>file a Jira issue.

Yes, just file a bug. If Tom's not freezing yet, I can fix it right now,
I'll just close the bug if I do.

-- Scott



More information about the dev mailing list