|
Thread thread = new Thread(new Runnable() {
@Override
public void run(){
try {
String result = sendRequest(REST_URL, modelString, requestFile);
JSONObject obj = JSON.parseObject(result);
String status = obj.getString("status");
if ("0".equals(status)) {
// word转pdf
String wordUrl = obj.getString("networkPath");
downloadFile(wordUrl, pdfFileTmep);
QrCode.CreateQrCode(content, qrCodeFileTmep, pdfFileTmep);
leg.setLeg(getLength(pdfFileTmep));
} else {
leg.setFalg(true);
throw new RuntimeException("合同文本附件过大!");
}
} catch (Exception e) {
// TODO 自动生成的 catch 块
e.printStackTrace();
}
}
});
thread.start();
while (leg.getLeg() == null) {
try {
Thread.sleep(1000);
} catch (InterruptedException e) {
e.printStackTrace();
}
}
当抛出这个throw new RuntimeException("合同文本附件过大!");异常时,系统就崩溃了,有什么解决方法吗?
|
|