如何在dynamics AX中创建不合格的catch块?
如何在 Dynamics AX 中创建不合格的 catch 块?
这是AX2009sp1的开发帮助,但没有例子。 所有有效的 catch 块都需要异常类型作为强制参数,例如:
catch(exception::error)
{
:
}
我错过了什么吗? br,
How to create an unqualified catch block in Dynamics AX ?
This is said dev help for AX2009sp1, but there is no example of it. All valid catch blocks need the exception type as mandatory parameter, for instance:
catch(exception::error)
{
:
}
have I missed something?
br,
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
您应该让 catch 子句不带参数。
以下是有关异常处理的精彩截屏:
http://channel9. msdn.com/posts/mfp/Exception-handling-in-X/
You should leave the catch clause without parameter.
Here is an excelent screencast on exception handling:
http://channel9.msdn.com/posts/mfp/Exception-handling-in-X/
我不了解AX,但我可以提供一些建议; 您可以尝试一起省略异常参数(即
catch() {...}
),或者使用异常参数可能的最通用类型(即object
或至少在许多其他语言中是这样的。I don't know AX, but I can offer some suggestions; you could try omitting the exception parameter all together (i.e.
catch() {...}
, or using the most generally type possible for the exception parameter (i.e.object
or the equivalent in your language). That's at least how it works in many other languages.“一种策略是让最后一个 catch 语句不指定异常类型”
http: //msdn.microsoft.com/en-us/library/aa893385.aspx
"One strategy is to have the last catch statement leave the exception type unspecified"
http://msdn.microsoft.com/en-us/library/aa893385.aspx