When we throw an exception, this exception needs to include information with other exceptions, we can use Java's exception chain mechanism. Because Excepiton, RuntimeException, and Throwable can achieve link other exception information by constructor parameters such as:
Throw new runtimeException (e);
If it is not the three exceptions above, then you need to implement it with the initcause () method, such as:
DynamicfieldSexception DFE =
NEW DYNAMICFIELDSEXCEPTION ();
DFE.INITCAUSE
New nullpointerserexception ());
Throw DFE;