【发布时间】:2019-01-06 08:12:53
【问题描述】:
解析器代码可用
try
{
id_source = await ParsingAll(0, "#adv_id", "");
foto_path = await ParsingAll(1, "img[id='print_user_photo']", "src");
position = await ParsingAll(0, "div.title.adv-title.newTitle > h1", "");
catch (Exception ex)
{
Error?.Invoke(id_source + "- Error - ");
}
如果字符串“foto_path”出现错误怎么办,然后处理try/catch错误后,程序继续工作,开始执行字符串“position”?
【问题讨论】:
-
嗯,解决方案取决于了解您对架构的要求是否可以接受在 ParsingAll 方法中添加 try catch inside。如果是,那么这是一个简单有效的解决方案
标签: c# exception exception-handling try-catch