first of not sure reason behaviour is, title might wrong.
i have 1 "mainclass" creates new object of "subclass" using method.invoke() method (with because there several "subclasses" having same method, if better way of solving this, appreciate it). exceptions thrown invoke() method needs caught have try {} catch () {} around it. seems when 1 of "subclasses" throws error , not directly in code below try block, not catch instead "mainclass" catches it.
i don't know if intended behaviour, appreciate way prevent happening.
example:
- mainclass invokes method of subclass
- method tries example
new gson().fromjson("test",arraylist.class);intryblock - mainclass catches exception
apprently problem not gson. happeneds the
try { new gson().fromjson(...); } catch (exception e) { logthaterror(); } correctly catched exception thrown gson logthaterror() caused exception well.
Comments
Post a Comment