Hello,
Currently, classes with several exception handling code blocks are giving us some problems. The process can occasionally succeed while also failing occasionally for no apparent reason (no infolog). Following a code analysis, we discovered that the problem revolved around a section of code that consisted of nested exception handling practices. As you can see from the code below, there is one major try/catch statement that has a number of smaller ones inside of it. Additionally, we have a method that essentially has the identical statements as the primary method within the nested try statement. Given this, I was debating the proper course of action in cases like this. Should I get rid of the particular clauses and just use the main method's generic one instead?
public void firstMethod() { while (...) { try { // Validations try { // My code this.secondMethod(); // My code } catch (Exception::Deadlock) { // My code } catch (Exception::UpdateConflict) { // My code } catch (Exception::DuplicateKeyException) { // My code } catch (Exception::Error) { // My code } catch { // My code } } catch (Exception::Error) { // My code continue; } } } public void secondMethod() { try { // My code } catch (Exception::Deadlock) { // My code } catch (Exception::UpdateConflict) { // My code } catch (Exception::DuplicateKeyException) { // My code } catch (Exception::Error) { // My code } catch { // My code } }
Hi,
Is there a way to move this thread or should I create a new one?
Hi Leah Ju,
We're currently still using AX CRM and 365 FinOps.
Hi Partner,
Could you tell me what app you are using in D365?
André Arnaud de Cal...
291,971
Super User 2025 Season 1
Martin Dráb
230,846
Most Valuable Professional
nmaenpaa
101,156