Skip to content

Commit

Permalink
Minor fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
stevenpan110 committed Jan 18, 2024
1 parent c82f872 commit d7d7df1
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 6 deletions.
3 changes: 2 additions & 1 deletion source/hunt/validation/DeclDef.d
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,8 @@ mixin template MakeValid()
{
mixin(makeValidInit);

// Debug
// Debug:
// bug: https://issues.dlang.org/show_bug.cgi?id=24344
// pragma(msg, makeDoValid!(typeof(this)));

mixin(makeDoValid!(typeof(this)));
Expand Down
8 changes: 3 additions & 5 deletions source/hunt/validation/validators/SizeValidator.d
Original file line number Diff line number Diff line change
Expand Up @@ -46,18 +46,16 @@ public class SizeValidator(T) : AbstractValidator , ConstraintValidator!(Size, T
}
else
{
throw new Exception("not support type : ",T.stringof);
_isValid = false;
return false;
throw new Exception("Unsupported type : ",T.stringof);
}

}

override string getMessage()
{
import hunt.text.FormatterWrapper;
import hunt.util.Serialize;
import hunt.serialization.JsonSerializer;

return new FormatterWrapper("{{","}}").format(_size.message,toJSON(_size));
return new FormatterWrapper("{{","}}").format(_size.message, toJson(_size));
}
}

0 comments on commit d7d7df1

Please sign in to comment.