Please extract this try-catch block to the upper level to avoid code duplication.