如何在dynamics AX中创建不合格的catch块?

发布于 2024-07-17 11:50:05 字数 192 浏览 5 评论 0原文

如何在 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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(3

丑疤怪 2024-07-24 11:50:05

您应该让 catch 子句不带参数。

try
{
   //...      
}
catch
{
   //... 
}

以下是有关异常处理的精彩截屏:

http://channel9. msdn.com/posts/mfp/Exception-handling-in-X/

You should leave the catch clause without parameter.

try
{
   //...      
}
catch
{
   //... 
}

Here is an excelent screencast on exception handling:

http://channel9.msdn.com/posts/mfp/Exception-handling-in-X/

蓝天白云 2024-07-24 11:50:05

我不了解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.

寒尘 2024-07-24 11:50:05

“一种策略是让最后一个 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

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文