web
You’re offline. This is a read only version of the page.
close
Skip to main content

Announcements

No record found.

News and Announcements icon
Community site session details

Community site session details

Session Id :
Microsoft Dynamics AX (Archived)

ax 2009 - best practice for try+catch block

(0) ShareShare
ReportReport
Posted on by

Hello,

I have try + catch block.

The catch should be empty - what is the best practice way doing that?

try {

// my code ...

} catch {

// do nothing.

}

Thanks :)

*This post is locked for comments

I have the same question (0)
  • Suggested answer
    StevenK Profile Picture
    Microsoft Employee on at

    Well having an empty catch statement wouldn't be best practice, but if you're going to do it then

    try

    {

     // do something

    }

    catch

    {}

  • Community Member Profile Picture
    on at

    Well - this is not best practice.

    I know that there is a way putting something instead of {} - I just forgot that ...

    What shall I put instead of catch {} ?

    Thanks :)

  • Suggested answer
    Daniel Weichsel Profile Picture
    on at

    The best practice is to call exceptionTextFallThrough() in the catch block -- and of course document the reason why nothing is done.

  • PopCola Profile Picture
    5 on at

    Hi, I'm currently migrating to X++ language from other .net PL. I'm kinda curious if the "finally" block is also available in X++. Is it? Thanks!

  • Suggested answer
    Community Member Profile Picture
    on at

    Hi POPCOLA,

    There is no finally statement in X++.

    Please review following link

    msdn.microsoft.com/.../aa893385.aspx

    Please verify, and let us know your findings

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Stars!

Meet the Microsoft Dynamics 365 Contact Center Champions

We are thrilled to have these Champions in our Community!

Congratulations to the March Top 10 Community Leaders

These are the community rock stars!

Leaderboard > 🔒一 Microsoft Dynamics AX (Archived)

#1
Joris dG Profile Picture

Joris dG 5

#2
Alexey Lekanov Profile Picture

Alexey Lekanov 2

#2
Henrik Nordlöf Profile Picture

Henrik Nordlöf 2 User Group Leader

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans