Closed DanielGoehler closed 4 months ago
Hi @DanielGoehler,
I've added an Try/Catch around the FindLocalVariables method, so you're unblocked now and we can investigate more targeted the code responsible for this exception.
You're absolutely right on a the exception handling and I'm open for suggestion on a approach on this. Currently I'm only familiar with the Try/Catch mechanism, which come with a cost regarding performance. Otherwise we could set a Try/Catch around every rule and/or method to prevent scenario's like this? 🤔
I like follow the suggestions from @dannoe on performance and error handling (https://github.com/StefanMaron/BusinessCentral.LinterCop/issues/284#issuecomment-1861395242). Unfortunately this is not yet implemented on all the rules combined.
Also some rules are moved from the CompanialCop, like the LC0044 rule here. This rule was a great gift and also a complex rule, where it's difficult to cover all possible scenario's. In this specific example I guess the ".. as
or is
for casting and then check for null.." is missing in the FindLocalVariables method. But I would like to see a code sample to see and test it this indeed would resolve the issue.
25.0.19932.0
Wait...this is the Next Major?
Currently we've just started supported multiple version of the AL Languages of the marketplace. Support for artifacts is more complex, as there are different versions of the AL Language in there. For example artifact 25.0.19997.0
comes with the AL Language version 14.0.1027044
which isn't available on the marketplace (yet).
The support for multiple AL Languages is working for VS Code. For pipelines I'm still searching for a possible solution.
@Arthurvdv Sure, I think balancing performance and reliability is important. If there is no single place for exception handling, having a template with basic exception handling would be beneficial.
Regarding the Next Major pipelines, I believe we need an ALOps extension because using alternativevsixurl: 'Latest'
cannot handle the Next Major Apps either.
##[warning]error AL1153: The referenced module 'System by Microsoft (25.0.19934.0)' with runtime reference version '14.0' cannot be loaded by the compiler with version '13.0'.
##[warning]error AL1153: The referenced module 'System Application by Microsoft (25.0.19977.0)' with runtime reference version '14.0' cannot be loaded by the compiler with version '13.0'.
##[warning]error AL1153: The referenced module 'Business Foundation by Microsoft (25.0.19977.0)' with runtime reference version '14.0' cannot be loaded by the compiler with version '13.0'.
##[warning]error AL1153: The referenced module 'Base Application by Microsoft (25.0.19977.0)' with runtime reference version '14.0' cannot be loaded by the compiler with version '13.0'.
##[warning]error AL1153: The referenced module 'Application by Microsoft (25.0.19977.0)' with runtime reference version '14.0' cannot be loaded by the compiler with version '13.0'.
Please tell me if this would be a solution to the above? https://github.com/HodorNV/ALOps/issues/766
@waldo1001 Thank you. This works. Left side without alternativevsixurl (ALC.exe from NextMajor) and right side with alternativevsixurl: 'Prerelease'
.
@Arthurvdv Thanks for your help. We will change our next release pipelines in ALOps to alternativevsixurl: Prerelease
so that ALC.exe will no longer crash.
Description
We are experiencing issues with the custom code cop, BCLinterCop, for the AL language extension. Unhandled exceptions within the BCLinterCop not only cause the ALC.exe to crash but also return an error code of -532462766. This causes our Azure DevOps pipelines to fail.
Current Behavior
When an unhandled exception occurs in the BCLinterCop, it breaks the ALC.exe and results in a pipeline failure. This makes it difficult to identify the root cause of the problem as the error details are insufficient.
Suggested Improvements
Global Exception Handling:
Enhanced Error Reporting:
Benefits
Additional Information
We are unable to share the entire AL project due to confidentiality, but we can provide more specific details if needed.