Closed mjmatthiesen closed 4 years ago
Don't crash. Return the string up to count characters.
Or at least, if this is really meant to be an error, catch it and make it a BC Error()
type, not an unhandled exception.
Don't crash. Return the string up to count characters.
Or at least, if this is really meant to be an error, catch it and make it a BC
Error()
type, not an unhandled exception.
Yes, should be a true error, but it can't be caught since the return type is already text. It's essentially just forwarding the problem from DotNet:
Exceptions The sum of startIndex and length is greater than the length of the current instance.
I resolved this in my code pretty readily, but I would like to see the base solution handle this better. These kind of errors can be pretty show stopping if they slip through testing.
Hi! Please take a minute to read the guidelines for this repository https://github.com/microsoft/AL and our collection of frequently asked questions https://github.com/Microsoft/AL/wiki/frequently-Asked-Questions .
As this repository is only for issues related to the AL compiler in latest developer preview environment for Dynamics 365 Business Central. We suggest that you open a support case or file a bug in Collaborate, to ensure that all Business Central users benefit from your catch as soon as possible.
To open a support case, you can:
If you file the bug in Collaborate, remember to include steps to reproduce the issue, and the Business Central build number and country version you're using.
Describe the bug If count (second int) is greater than the length, BC will crash
To Reproduce Steps and to reproduce the behaviour:
Expected behavior Don't crash. Return the string up to count characters.
Screenshots
5. Versions: