Validation failures can sometimes be subtle in their presentation (a somewhat cryptic log message) and it's not always evident who the offending sender is.
For some failure modes -- like sending a null handle for a non-nullable handle field -- we do DCHECKing within the sender during serialization. We should do more of this, because it makes locating bad code much easier.
Example things we could DCHECK/assert in serialization that we don't today:
- enum value checks
- invalid union tags
- anything in Java bindings
It's not clear that we have a good option for JS bindings that wouldn't bloat the code, but maybe at least in development builds (is_dcheck_on) we could generate extra assertions in the JS.