1
0
错误的描述自然会出现在您调用它的UI层上,因此您可以通过在那里显示消息来捕获和处理错误。下面是一个伪代码示例,可能有助于解释我的意思:
注意:您可能需要更改以上内容以捕获所有异常
如果希望从不同的过程类中获得特定消息,则可以执行以下操作:
这些信息将与您指定的消息一起捕获到调用UI层中。有多种方法可以捕获/处理错误,但关键是错误会向上传递;您不需要数据传输对象(DTO)来发送该信息。 |
lfox · 如果列中不存在某个值,则停止代码执行 2 年前 |
zaen · 将值传递到异常字符串消息中 2 年前 |
Zephyr · 如何在双ListView选择系统上实现过滤器? 6 年前 |
Aave · 错误数组长度的特定异常 6 年前 |