Exception --> logged error in ResolvePackageAssets #40851
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Resolves AB#2047667
I confirmed with the customer that this was not an unexpected error for them but rather one where they hadn't expected to see a full stack trace; they'd just wanted to see a clean message about what went wrong.
This is in the ResolvePackageAssets task. It would be nice if instead of throwing an exception, we could log an error. Unfortunately, the code that actually throws is deep in another class, which means we would have to either return the error up the stack or catch any NRE from almost anywhere in ResolvePackageAssets. This does neither by converting the NRE into a new exception type at the point where the exception might be expected, then catching it and logging an error at the top level.
Also let me know if you want me to push the catch (AcceptableNullReferenceException) down the stack a bit.