Using logging would be definitely better, and maybe the exception should be rather rethrown (even if wrapped into RuntimeException)