The code above can't throw checked exception so its better to catch RuntimeException as that makes it clear that we actually want to catch possible RuntimeException.