提交 c5d5b3aa 编写于 作者: 麦壳饼's avatar 麦壳饼

重写错误提示

上级 0c01cc70
......@@ -58,27 +58,19 @@ namespace IoTSharp.Jobs
case DataCatalog.AttributeData:
var result2 = await _dbContext.SaveAsync<AttributeLatest>(msg.MsgBody, device, msg.DataSide);
if (result2.exceptions?.Count > 0)
result2.exceptions?.ToList().ForEach(ex =>
{
_logger.LogError(Newtonsoft.Json.JsonConvert.SerializeObject(msg.MsgBody));
}
else
{
_logger.LogInformation(Newtonsoft.Json.JsonConvert.SerializeObject(result2));
}
_logger.LogError($"{ex.Key} {ex.Value}");
});
break;
case DataCatalog.TelemetryData:
await _storage.StoreTelemetryAsync(msg);
var result1 = await _dbContext.SaveAsync<TelemetryLatest>(msg.MsgBody, device, msg.DataSide);
if (result1.exceptions?.Count > 0)
{
_logger.LogError(Newtonsoft.Json.JsonConvert.SerializeObject(msg.MsgBody));
}
else
result1.exceptions?.ToList().ForEach(ex =>
{
_logger.LogInformation(Newtonsoft.Json.JsonConvert.SerializeObject(result1));
}
_logger.LogError($"{ex.Key} {ex.Value}");
});
break;
default:
break;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册