From 9f79db3a635ba2db97b32454e3dcdebfff60f1e3 Mon Sep 17 00:00:00 2001 From: CaiHQ Date: Thu, 5 May 2022 13:28:29 +0800 Subject: [PATCH] update docker configs --- src/main/java/org/bdware/sc/ContractManager.java | 7 ++++++- src/main/java/org/bdware/sc/MultiContractRecorder.java | 2 +- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/src/main/java/org/bdware/sc/ContractManager.java b/src/main/java/org/bdware/sc/ContractManager.java index 40dc459..3d6f51e 100644 --- a/src/main/java/org/bdware/sc/ContractManager.java +++ b/src/main/java/org/bdware/sc/ContractManager.java @@ -799,6 +799,11 @@ public class ContractManager { try { if (c.getScriptStr().startsWith("/")) { c.startInfo.isYPK = true; + File ypkFile = new File(c.getScriptStr()); + if (!ypkFile.exists()) { + r = new ContractResult(Status.Error, new JsonPrimitive("no such ypk file")); + return JsonUtil.toJson(r); + } String[] str = c.getScriptStr().split("/"); String tmp = new File(dir + "/publicCompiled/ypkName").getAbsolutePath(); String[] str2 = tmp.split("/"); @@ -924,7 +929,7 @@ public class ContractManager { } } catch (Exception e) { e.printStackTrace(); - r = new ContractResult(Status.Error, new JsonPrimitive("exception occurs")); + r = new ContractResult(Status.Error, new JsonPrimitive("exception occurs: " + e.getMessage())); return JsonUtil.toJson(r); } } diff --git a/src/main/java/org/bdware/sc/MultiContractRecorder.java b/src/main/java/org/bdware/sc/MultiContractRecorder.java index 601dbac..4cb3c27 100644 --- a/src/main/java/org/bdware/sc/MultiContractRecorder.java +++ b/src/main/java/org/bdware/sc/MultiContractRecorder.java @@ -23,7 +23,7 @@ public class MultiContractRecorder extends StatusRecorder { CMTables.LastExeSeq.toString(), meta.getContractID())); meta.setLastExeSeq(lastExeSeq); } catch (Exception e) { - e.printStackTrace(); + LOGGER.error(e); } } }