Code could be more null-safe and also need some separation of multiple Exceptions, but maybe this will help you "better see how you want things to be printed."