Added some additional information to the bad constants exception.

Only of marginal utility but it was a nice sanity check.
This commit is contained in:
Paul Speed 2015-12-31 04:27:05 -05:00
parent a0569b340d
commit ac5cc5312b

View File

@ -48,8 +48,9 @@ public class EnumSerializer extends Serializer {
if (ordinal == -1) return null;
T[] enumConstants = c.getEnumConstants();
if (enumConstants == null)
throw new SerializerException( "Class has no enum constants:" + c );
if (enumConstants == null) {
throw new SerializerException("Class has no enum constants:" + c + " Ordinal:" + ordinal);
}
return enumConstants[ordinal];
} catch (IndexOutOfBoundsException ex) {
return null;