Hello, we have implemented such feature in our development branch. This feature will be available in TMS XData version 2.9. If you need this before release, please contact us directly for a patch.
Here is how you should use it:
Module.Events.OnModuleException.Subscribe(
procedure(Args: TModuleExceptionArgs)
begin
if Args.ErrorCode = 'ValidationError' then
Args.StatusCode := 406;
end
);