Fix bug DNN-3466: add the try-catch to handle exception when generate url.