feat: update logs in event mechanism

update LOGGER.warn in exception handling in ContractConsumer to LOGGER.error
This commit is contained in:
Frank.R.Wu 2021-12-10 17:39:49 +08:00
parent a9ba6fea6e
commit f2e39a634d

View File

@ -92,14 +92,16 @@ public class ContractConsumer implements IEventConsumer {
if (callCount.get() == TIMEOUT_COUNT || if (callCount.get() == TIMEOUT_COUNT ||
(result.status == ContractResult.Status.Exception && (result.status == ContractResult.Status.Exception &&
result.result.toString().contains("not exported"))) { result.result.toString().contains("not exported"))) {
LOGGER.warn("receiving event error: request failed!"); LOGGER.error(String.format(
"receiving event error! %s.%s: %s", contract, handler, str));
rc.onResult((String) null); rc.onResult((String) null);
} else { } else {
ret = false; ret = false;
} }
} }
} catch (Exception e) { } catch (Exception e) {
LOGGER.warn("receiving event error! " + contract + "." + handler + ": " + e.getMessage()); LOGGER.error(String.format(
"receiving event error! %s.%s: %s", contract, handler, e.getMessage()));
rc.onResult((String) null); rc.onResult((String) null);
} }
callCount.incrementAndGet(); callCount.incrementAndGet();