Added debug log lines into catch statements