抛出的异常 没有捕获到
try {
fileUrl = ftp.storeByExt(site.getUploadPath(), ext, file
.getInputStream());
} catch (IllegalStateException e) {
model.addAttribute("error", e.getMessage());
} catch(ConnectException e) {
model.addAttribute("error", "上传视频失败,ftp连接错误");
} catch (IOException e) {
model.addAttribute("error", e.getMessage());
}
后台明确 抛出的 是java.net.ConnectException: Connection refused: connect
public String storeByExt(String path, String ext, InputStream in)
throws IOException {
String filename = UploadUtils.generateFilename(path, ext);
store(filename, in);
return filename;
}