There is logic within the serialization code that specifically handles Throwables. Custom Exceptions are only supported if they contain a zero or one-arg constructor, but beyond that, any custom attributes (setters/getters/fields) will be ignored. So, the custom Exception will be re-constituted on the other side, but those extra attributes will be null. This is because the serialization logic handles Throwables in a specific fashion, before - and instead of - our bean-handling serialization logic (specifically, our AccessNode logic).
|