New Rule: TryFunctions should only be used on low level functions without database operations #533
Replies: 2 comments 1 reply
|
I remember that we hade same idea in the BusinessCentral.LinterCop repo on Write transaction in the scope of a The consensus back then was:
Now almost 2 year later, I no longer see “traversing the whole tree of chained methods” as an issue anymore. But I still believe the “false sense of security” risk is still there. Even if we can traverse the call tree within an extension, there probably will boundaries we cannot reliably cross, like extension dependencies, interfaces, injected implementations, etc. So now could be the time to revisit this with a fresh pair of eyes. How should the rule should look like? I’d love to hear ideas from the BC community on this 🤗 |
Uh oh!
There was an error while loading. Please reload this page.
TryFunctions should only be used on low level functions without database operations
This is my claim. But is it true?
What do you think? Is there a reason for a new rule?
TryFunction on high level functions
When using
[TryFunction]on a function that calls other functions it becomes complicated to understand where the error happend.TryFunctions on functions with database operations
I am not sure where I picked this up, but I ether read it somewhere or someone told me.
But apparently, it should be a bad idea to have TryFunctions on functions with database operations.
Examples
Examples on how to use
[TryFunctions]from My article on TryFunctions in ALAnd the use of it.
All reactions