use of io.nuls.core.exception.NulsException in project nuls by nuls-io.
the class NulsByteBuffer method readInt32LE.
public int readInt32LE() throws NulsException {
try {
int u = Utils.readInt32LE(payload, cursor);
cursor += 4;
return u;
} catch (ArrayIndexOutOfBoundsException e) {
throw new NulsException(ErrorCode.DATA_PARSE_ERROR, e);
}
}
use of io.nuls.core.exception.NulsException in project nuls by nuls-io.
the class NulsByteBuffer method readInt64.
public long readInt64() throws NulsException {
try {
long u = Utils.readInt64LE(payload, cursor);
cursor += 8;
return u;
} catch (ArrayIndexOutOfBoundsException e) {
throw new NulsException(ErrorCode.DATA_PARSE_ERROR, e);
}
}
use of io.nuls.core.exception.NulsException in project nuls by nuls-io.
the class NulsByteBuffer method readByte.
public byte readByte() throws NulsException {
try {
byte b = payload[cursor];
cursor += 1;
return b;
} catch (IndexOutOfBoundsException e) {
throw new NulsException(ErrorCode.DATA_PARSE_ERROR, e);
}
}
use of io.nuls.core.exception.NulsException in project nuls by nuls-io.
the class NulsByteBuffer method readInt16LE.
public short readInt16LE() throws NulsException {
try {
short s = Utils.readInt16LE(payload, cursor);
cursor += 2;
return s;
} catch (ArrayIndexOutOfBoundsException e) {
throw new NulsException(ErrorCode.DATA_PARSE_ERROR, e);
}
}
use of io.nuls.core.exception.NulsException in project nuls by nuls-io.
the class Log method trace.
/**
* 提供trace级别基本的日志输出
*
* @param msg 需要显示的消息
* @param throwable 异常信息
*/
public static void trace(String msg, Throwable throwable) {
String logContent = isStringBlank(getId()) ? (getLogTrace() + ":" + msg) : (getLogTrace() + "[" + getId() + "]" + ":" + msg);
if (!(throwable instanceof NulsException) || !(throwable instanceof NulsRuntimeException)) {
throwable = new NulsException(ErrorCode.FAILED, throwable);
}
LOG.trace(logContent, throwable);
}
Aggregations