fix(sync): 优化错误信息打印
This commit is contained in:
@@ -66,7 +66,7 @@ public class PulsarMessage2RecordFunction extends RichMapFunction<String, Record
|
|||||||
if (StrUtil.isNotBlank(opTs) && OPTS_PATTERN.matcher(opTs).matches()) {
|
if (StrUtil.isNotBlank(opTs) && OPTS_PATTERN.matcher(opTs).matches()) {
|
||||||
timestamp = LocalDateTime.parse(opTs, FORMATTER).toInstant(ZoneOffset.ofHours(8)).toEpochMilli();
|
timestamp = LocalDateTime.parse(opTs, FORMATTER).toInstant(ZoneOffset.ofHours(8)).toEpochMilli();
|
||||||
} else {
|
} else {
|
||||||
throw new Exception("Opts is not match regex " + OPTS_PATTERN.pattern());
|
throw new Exception(StrUtil.format("Opts is not match regex {} value: {}", OPTS_PATTERN.pattern(), opTs));
|
||||||
}
|
}
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
logger.error("Parse operation time error", e);
|
logger.error("Parse operation time error", e);
|
||||||
|
|||||||
@@ -155,7 +155,7 @@ public class PulsarMessageSourceReader extends RichParallelSourceFunction<String
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
} catch (Throwable t) {
|
} catch (Throwable t) {
|
||||||
logger.error("Read message failure, current value: " + currentValue, t);
|
throw new Exception("Read message failure, current value: " + currentValue, t);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user